Originally Posted by
laserlight
In this case 0 is not a magic number that should be replaced with a named constant because it is well known that return value of strcmp is to be compared with respect to 0. Instead, EQUAL is a "magic constant". For example, strcmp(x, y) > 0 is a test for whether x is > y: the ">" indicates the intended comparison. strcmp(x, y) > EQUAL is a test for whether... huh? As such, if I were your professor, I would mark you down for using EQUAL. And no, ZERO does no better as it does not provide any additional information, and it is extremely implausible (and misleading if it were so) that ZERO might be defined to something else. In this case, 0 is correct.