Get Paid By Click

Mginger Mobile Money

Dec 22, 2009

Enum DataType in C

The enum statement
ENUM is closely related to the #define preprocessor.
It allows you to define a list of aliases which represent integer numbers. For example if you find yourself coding something like:

#define MON 1
#define TUE 2
#define WED 3
You could use enum as below.
 enum week { Mon=1, Tue, Wed, Thu, Fri Sat, Sun} days;
 or
 enum escapes { BELL = '\a', BACKSPACE = '\b', HTAB = '\t',
 RETURN = '\r', NEWLINE = '\n', VTAB = '\v' };

 or
 enum boolean { FALSE = 0, TRUE };

An advantage of enum over #define is that it has scope This means that the variable (just like any other) is only visable within the block it was declared within. 






Easy Way To Pay

Sign up for PayPal and start accepting credit card payments instantly.

Earn While Searching