Skip to content

Instantly share code, notes, and snippets.

@derofim
Created August 14, 2015 07:32
Show Gist options
  • Select an option

  • Save derofim/e168bbe33570601805a6 to your computer and use it in GitHub Desktop.

Select an option

Save derofim/e168bbe33570601805a6 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
enum class Color : char { RED, GREEN, BLUE };
enum class Mark { ONE, TWO, THREE, FOUR, FIVE };
Color redColor = Color::RED;
Mark fiveMark = Mark::FIVE;
int main()
{
cout << sizeof ( Color ) << endl; // Вывод: 1
cout << sizeof ( redColor ) << endl; // Вывод: 1
cout << sizeof ( Mark ) << endl; // Вывод: 4
cout << sizeof ( fiveMark ) << endl; // Вывод: 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment