News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

enumerated type

Started by buckbuilt03, August 10, 2011, 02:14:31 AM

Previous topic - Next topic

buckbuilt03

Can actual numbers be used as enumerated constants?   Example:  typedef enum   {1, 3, 5, 6, 7}  numbers_t;
  I know that each position represents an integer value beginning with zero but, can numbers be valid as constants??  Thanks for any help.

CommonTater

I may be corrected on this one but I believe the constants in an enum follow the C rules for variable names, in that they cannot begin with a number.


buckbuilt03

yea, the constants cannot be numeric, character or string literals.....Thanks tater!

CommonTater