Using Enumerations in C++ »
By admin on May 24, 2009 in Working with C++ | Comments Off on Using Enumerations in C++
Enumerations in C++ work in a similar manner to other languages, to restrict a particular variable to having a specific set of values. For example: enum Names {Fred, Mary, John, Anne} In this case, a new type is created, which may have <b>only</b> the values Fred, Mary, John, Anne. The compiler will represent Fred as […]