The type enum cmdsand elements of the enumeration A, Band Care local to the scope of functions.
Note that while enumerations do not introduce a new scope for their member constants, they fall into scope, in this case the body of the function.
int doSomething(void)
{
enum cmds {
A, B, C
};
return C;
}
int anotherThing(void)
{
enum cmds {
C, D, E
};
return C;
}
Run the sample code here at Coliru
source
share