Archive for May, 2009

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 […]