more on TRUE and FALSE (side-comment)

Jeffrey T. Hutzelman jh4o+ at andrew.cmu.edu
Tue Sep 18 00:00:24 AEST 1990


Try

if (!strcmp(name,"hippo"))

It works, although it's a bit confusing to those who don't know that
strcmp() returns 0 for equal and non-0 for unequal.

Or, write a macro:

#define strequ(a,b) !strcmp(a,b)
if (strequ(name,hippo))
-----------------
Jeffrey Hutzelman
America Online: JeffreyH11
Internet/BITNET:jh4o+ at andrew.cmu.edu, jhutz at drycas.club.cc.cmu.edu

>> Apple // Forever!!! <<



More information about the Comp.lang.c mailing list