+ 1
Differences between enum and enum class and typedef enum
Hi, I would like to know the differences between declaring an enum variable using these 3 types of declaration: enum, enum class, typedef enum.
2 ответов
0
typedef enum is for C, in C++ we don't do it.
enum {} is the same thing as having many global variables.
GAMEOVER
enum class className {} means they will be local to their className scope. For example
className::GAMEOVER
Even you can declare enum by their data type
enum: unsigned long long {}
enum class cn: uint_16 {}
0
I read that members of unscoped enumerators (enum Enum_{}) cannot be obtained with scope resolution operator (::), but I found that this is not the case. Why?