C Programming Reference


C Programming Reference >> C Basic Tutorials >> C Keywords Home >>

enumui

30/12/06 -  Views - Ratings :   3.48 of 5 / 155 Votes

The enum keyword is use to create user defined integer variables . In other words its giving name to a integer number. Enum keyword is hardly used for programming due its little use. The default value of first enum variable is zero. Intial Value of any variable can be changed and next value is one greater than the last. Following example will make it clear -

Code -
enum alphabets {A,B,C=100,D};

void function (void)
{
printf ("%d %d %d %d", A,B,C,D); \\This displays 0 1 100 101  
}

Back To Top


      

 

 

© 2006 cencyclopedia.com