Enumeration in C language?


Enumeration in C?




·  Enumeration is nothing but a User-defined data type in C language.
·      It is used to assign names to integral constants.
·      Enum is defined in a c program using enum keyword.
·    Enum is such type of user defined data type which allows us to add different type of constant variables in one variable which is of type enum just like we did it in structure.
·      Declaration of Enum :

Enum enum-name
{
     Data type Member-name=value;
     -//--
}variable of type enum;

·      Example:-

Enum Boolean
{
     True=1;
     Flase=0;
}e1;

Comments

Popular Posts