+ 6
What is enum ??
4 Réponses
+ 11
An enumeration is a user-defined data type that consists of integral constants. To define an enumeration, keyword enum is used.
enum season { spring, summer, autumn, winter };
Here, the name of the enumeration is season.
And, spring, summer and winter are values of type season.
By default, spring is 0, summer is 1 and so on. You can change the default value of an enum element during declaration (if necessary).
enum season { spring = 0, summer = 4, autumn = 8, winter = 12 };
+ 6
it is integral constants
+ 5
the values of spring,summer...should be integers or anyother datatype??
+ 5
oh I see ,