Chapter
Enumerated Types
From ComputerScienceOne by Dr Chris Bourke
Concepts
- Why are enumerated types better than arbitrary integer error codes?
"The usage of the integers 1, 2, 3 to indicate the various errors was arbitrary. These are essentially magic numbers that the calling function would have to deal with by making comparisons with variou
- How do you declare an enumerated type in C?
"C allows you to define enumerated types which allow you to define a fixed list of possible values. For example, the days of the week or months of the year are possible values used in a date. However,