Code:
#include<stdio.h>
int main()
{
int east = 5;
enum direction {
north,
south,
west
};
enum direction points;
points = east;
if (points == north)
printf("The direction is north\n");
else
printf("The direction is not north\n");
return 0;
}
In an effort not to hijack another thread i created this one for a little
help understanding enum
now according to what im told/read this code should generate an error
when compiling because im assigning it something thats not enum'ed
at least a warning. This is not so. Gcc gives no error or warning not even
with -Wall
so is this a leagal use of enum or should i be getting a warning ?