Tuesday, 5 June 2018

Enum

An enum is a keyword, it is an user defined data type. All properties of integer are apples to Enum. It is used for creating an user defined data type of integer. Using enum we can create sequence of integer constant value.

Key Points :


  • With the help of enumeration we can put a name for constant.
  • User readability improves;
  • Default first member value is 0(zero)
  • We cannot increment or decrement.
Syntax :

enum { red, black = 5, white, green };