Enumerable Types
Types that consist of certain integral valuesand are carried by symbolic names
#define FALSE 0 #define TRUE 1 or:Enum definitions:enum bool {FALSE,TRUE}; /*bool optional*/ enum month {JAN=1,FEB=2,…,DEC=12};enum colors {WHITE=1,BLACK,GREEN=8,RED}; /* month, colors optional */
Using enum typesenum bool b[10]; enum bool cond = FALSE;Note: cond = 2; is legal but will crash!
enum vs. #define ( enum is superior)- compiler may check for type mismatch.- debugger may recognize the symbolic names.