Compare commits

...

1 Commits

Author SHA1 Message Date
Alexander Zhirov 43fb8bd1dd lesson_61 2021-09-11 22:15:49 +03:00
1 changed files with 30 additions and 0 deletions

30
lesson_61/main.cpp Normal file
View File

@ -0,0 +1,30 @@
/*
* main.cpp
*
* Created on: 11 сент. 2021 г.
* Author: alexander
*/
#include <iostream>
int main()
{
enum class Race
{
OGRE,
GOBLIN,
SKELETON,
ORC,
TROLL,
};
Race Rexxar(Race::OGRE);
using std::cout;
using std::endl;
// Необходимо явное преобразование, т.к. перечисление
// является классом, имеет локальную область видимости
cout << static_cast<int>(Rexxar) << endl;
return 0;
}