C
CBFalconer
nrk said:.... snip ...
PS: Your book, section 4.2: The WAR style example of strcmp is
atrocious IMO. If you must insist on a single return, here's a
clearer version of strcmp:
int strcmp(const char *s1, const char *s2) {
while ( *s1 == *s2 && *s1 )
++s1, ++s2;
return *s1 - *s2;
}
if (sizeof int == 1) that code has an incipient bug.