Go Down

Topic: enumeration declaration (Read 4989 times) previous topic - next topic


Code: [Select]
!strcmp(x, "orange")

It works in that example, but IMO it's bad practice to treat the return value from strcmp() as a boolean since it isn't one. I'd much rather see an explicit comparison with zero. (Apart from that quibble, I think you've described the simplest and most straight forward implementation.)

Yeah, and all if statement expressions should be followed by a compound {} statement  ;)

Go Up