# C++ changes to ENUM.

In the C++ world, the rules applying to enum have been altered.

- Definitions no longer require the enum prefix or a typedef fudge.

        main ()
        {
            enum Currancy = {STERLING, DOLLAR, RUPEE};

            enum Currancy GreenBack = DOLLAR;     // Valid in C and C++
            Currancy Pounds = STERLING;           // Valid in C++ only.

        }

- An enum is no longer considered to be an int datatype. Because it has its own datatype you can not perform normal arithmatic apon enum variables. The following program is now invalid.

        main ()
        {
            enum Currancy = {STERLING, DOLLAR, RUPEE};

            Currancy Pounds = STERLING;

            Pounds = 2;             // Invalid Statement.

            Pounds++;               // Invalid Statement.
        }

## Examples:

Example program.

## See Also:

## C References

C version of enum.

Top | Master Index | C++ Keywords | Functions