Enumerated Type - Fortran

Fortran

Fortran only has enumerated types for interoperability with C; hence, the semantics is similar to C and, as in C, the enum values are just integers and no further type check is done. The C example from above can be written in Fortran as

enum, bind( C ) enumerator :: CLUBS = 1, DIAMONDS = 2, HEARTS = 4, SPADES = 8 end enum

Read more about this topic:  Enumerated Type