Sunday, February 6, 2011

enum in c


enum
is keyword of c with the help of enum we can create large numbers of constant
of type int, which are known as enum constants.


Syntax:




Note. [ ] indicate that they are
optional.

Example:

enum color{RED=1,GREEN=2,YELLOW=3}

c1, c2, c3;


Explanation of each term in syntax:


1.
: It is name of set
of all enum constants. Name of tag must be a valid identifier. This must be

No comments:

Post a Comment