Pages: 1 [2]   Go Down
Author Topic: enumeration declaration  (Read 1527 times)
0 Members and 1 Guest are viewing this topic.
Temple, Texas
Offline Offline
Sr. Member
Karma: 14
Posts: 361
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

!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  smiley-wink

Pages: 1 [2]   Go Up
Jump to: