| Start |
|---|
| Enumeration with duplicate value An enumerations value in no way needs to be unique: The sample prints: |
| enumeration constant without typename Enumeration types can also be declared without giving them a name: This enables us to define compile time constants of type |
| Simple Enumeration An enumeration is a user-defined data type consists of integral constants and each integral constant is given a name. Keyword If you use Example 1With a main function defined as follows (for example): Example 2(This example uses designated initializers which are standardized since C99.) The same example using range checking: |
| Typedef enum There are several possibilities and conventions to name an enumeration. The first is to use a tag name just after the This enumeration must then always be used with the keyword and the tag like this: If we use But in this latter case we cannot use it as Function: For more on RemarksEnumerations consist of the An identifier is of type The enumerator-list has at least one enumerator element. An enumerator may optionally be "assigned" a constant expression of type An enumerator is constant and is compatible to either a If no constant expression is "assigned" to an enumerator and it is the 1st entry in an enumerator-list it takes value of Using multiple "assignments" can lead to different enumerators of the same enumeration carry the same values. |
Read Article
https://develop.horje.com/learn/1434/reference