This chapter is for readability and the code is self-documenting.
1.typedef Creating user-defined Types
2.enum Creating enumeration types
The enumeration type specifies the range of variables (which can only be evaluated in the specified label), which is commonly used by state machines.
Enumeration types are similar to arrays with specialized system functions.
< enumeration variable name >.first– returns the value of the first member of an enumeration list
< enumeration variable name >.last– returns the value of the last member of the enumeration list
< enumeration variable name >.next (<N>) – Returns the value of the next member of the enumeration list, which can be used as an integer for the second argument, which returns the value of the nth member later
< enumeration variable name >.prev (<N>) – Returns the value of the previous member in the enumeration list
< enumeration variable name >.num– returns the number of elements in the enumeration list
< enumeration variable name >.name– returns the string that corresponds to the value of the enumeration variable and returns an empty string if the value is not in the enumeration variable list
Chapter Fourth: User-defined and enumerated data types