Question about toupper and tolower

Morris Keesan keesan at bbncca.ARPA
Fri Nov 11 06:34:15 AEST 1983

The definitions of toupper and tolower on BBN UNIX systems were changed nearly
three years ago to leave the character in the desired case if it already is.
It doesn't appear to have broken anything in that amount of time.  Incidentally,
the efficient way to do this is NOT to build a definition that looks like
(isupper(c)?(c):toupper(c)), but simply to replace the addition and subtraction
operations with bitwise AND and OR operators to turn on or off the ASCII
lower-case bit.
						Morris M. Keesan

More information about the Comp.lang.c mailing list