Here is my code:
#include <stdio.h>
int main()
{
enum C {green = 5, red};
enum CC {blue, yellow} cc = green;
printf("%i\n", cc);
return 0;
}
It does compile, and produce console output 5.
cppreference.com says that "An enumerated type is a distinct type whose value is restricted to one of several explicitly named constants (enumeration constants)". I am really confused.
By the way, the compiler I'm using is gcc version 4.8.1.