Advertisement

Enums

  • Mikael Olsson
Chapter

Abstract

An enum is a user-defined type consisting of a fixed list of named constants. In the following example, the enumeration type is called color and contains three constants: RED, GREEN and BLUE.

enum color { RED, GREEN, BLUE };

Copyright information

© Mikael Olsson 2019

Authors and Affiliations

  • Mikael Olsson
    • 1
  1. 1.Hammarland, Länsi-SuomiFinland

Personalised recommendations