Go Down

Topic: enumeration declaration (Read 1 time) previous topic - next topic

johncc



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