Grouse: What's the point of enum?

Rogue Winter rogue at cellar.UUCP
Thu Apr 18 14:26:15 AEST 1991


When I wanted to start learning C, I expected enumerated types to be very 
useful in combination with the increment and decrement operators.  I hoped to 
be able to use printf(...%s...) to show the named value I'd given a constant.

Neither experiment had the desired effect.  I'm sure you all know the results 
of such operations involved.  The point is, if increment operators on 
enumerated variables don't produce increments of the defined values in the 
enum statement (and enumerated variables are capable of having values
not included in the explicit declarations), why bother declarig values for 
them?

If the names given to enumerated values cannot be printed, why do they exist? 
The only purpose I can see is that they become local symbolic constants.

Forgive a young novice her screed, but this just don't seem kosher.

Rogue Winter      : "How can you say I only protected people in South
rogue at cellar.uucp : Philadelphia?  I protected people all over this city; it
uunet!cellar!rogue: didn't matter if they were in South Philadelphia or
Cellar 215/3369503: Northeast Philadelphia."  -- Frank Rizzo, 4/12/91



More information about the Comp.lang.c mailing list