0

can more variables have the same value in an enum ?

eg.

enum boolean
{
        true = 1, false = 0, TRUE = 1, FALSE = 0
};
2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by Bench
0

Why don't you try it for yourself and find out? If the compiler doesn't complain, then you know its ok

The only point where your compiler might produce an error, is if you attempt to compile under C++, where true and false are reserved words which cannot be reused elsewhere. This shouldn't be an issue under C

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.