- enum () is a key word.
- It contains no. of integer constants which will be identified by named constants.
- Syntax:enum enumName
{
enumeration list}
E.g.: enum Color
{
Red,
Green,
Blue
}
- The members of an enumeration are accessed through their type-name and the dot operator.E.g.: Color.Red;
- Enumeration improves code readability.
- It also helps in avoiding typing mistake.
Enumaration (enum)
Subscribe to:
Post Comments
(
Atom
)
0 comments :
Post a Comment