|
Re: syntax error using enum{}
Quote:
|
Originally Posted by Matt Leese
For one, enums aren't part of the C standard (unless they were add in ISO C99). Second, you have to give the enum a name. I believe the syntax is:
enum <name> {
<enum values>
};
|
According to my copy of K & R Second Edition (ANSI C Edition) enumerations are defined in Appendix A (Reference Manual) section A8.4. The identifier (what you show as <name>) is indicated as optional.
Besides, if enum{} wasn't allowed, just changing the names of the identifiers would not have eliminated the syntax error. But it did.
I'm still confused.
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.
|