Re: Question about "enums"



mdh wrote:
Ian Collins wrote:


Assigning any other value to a loop is undefined. Unfortunately C
compilers don't regard this as an error, which renders enums little more
than symbolic constants.



Is this what you mean?

enum months{Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec};
enum months mymonths=14; / * Should really raise an outofbounds
exception ? */

Yes, it sure does in C++.

--
Ian Collins.
.