View Single Post
  #3   Spotlight this post!  
Unread 04-02-2005, 14:18
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
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.