an enumeration based on char rather than an int
Posted on 2006-07-07
Hey, I read that it is possible to base an enumeration on other data types rather than an int to save memory. each member of an int based enumeration takes 32 bit and according to my book if you base it on a char, everything will fit into one byte.
__value enum WeekDay : char
Monday = 1, Tuesday..... , Sunday
can anyone explains me what exactly happens here and how does the compiler know to base it on an int? the notation seems like the notation for deriving a class from a base class