Enumeration S
Enumeration S
Ikram Ullah
Assistant Professor
(Computer Science)
Enumerations
▪ Less cruicial than structures but can sim plyfy and clarify program s
▪ Syntax
▪ enum _name: It is the nam e of enum eration. It can be any user-defined nam e
▪ List of values: These are com ma separated list of values that can be assigned to enum erator. These are
also called as enum erators.
▪ In m ost cases, enum erators them selves don't hold values; rather, they serve as sym bolic nam es for
integer constants.
Enumerations
▪ Exam ple
enum Days{Sun, Mon, Tue, Wed, Thu, Fri, Sat}; //Each value is assigned an index starting from 0
void m ain()
cout<<Val1<<Val2;
▪ sdfsdjf
Enumerations
▪ Like:
05