Share this page

# enum

Creates an enumeration specifier. Enumeration allows a series of constant integers to be easily assigned. The format to create a enumeration specifier is:

    enum identifier {enumerator-list};

Identifier is a handle for identification, and is optional. Enumerator-list is a list of variables to be created. Each variable must be a constant integer, and is given the value of the previous variable plus 1. The first variable is given the value of 0.

## Example

In the following example, the day enum, today, is set to Sat. Note that because Fri is set to 100, Saturday takes the successive value.

Copy code

        enum day {Sun, Mon, Tue, Wed, Thu, Fri = 100, Sat};
        int i;
        enum day today;
        today = Sat;
        lr_output_message ("Value of today is %i", (int)today);

    Example: Output:
    Action.c(11): Value of today is 101

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: