ONC+ Developer's Guide

Declaration

Enumerated data is declared as follows:

enum {name-identifier = constant, ... } identifier;

For example, an enumerated type could represent the three colors red, yellow, and blue as follows:

enum {RED = 2, YELLOW = 3, BLUE = 5} colors;

It is an error to assign to an enum an integer that has not been assigned in the enum declaration.