You must declare the enumeration data type before you can define a variable having that type.
Enumeration variable declaration syntax .-----------------------------. V | >>---+-------------------------+-+--enum--tag_identifier--------> +-storage_class_specifier-+ '-type_qualifier----------' >--declarator--------------------------------------------------><
The tag_identifier indicates the previously-defined data type of the enumeration.
The keyword enum is optional in enumeration variable declarations.
Related information