toupper and tolower

jreuter at cincy.UUCP jreuter at cincy.UUCP
Sun Nov 13 05:51:56 AEST 1983


In version 7 and probably the Berkeley 4.? stuff, toupper() and tolower()
ARE macros in ctype.h.  In system III and beyond, this has changed:
the macros are named _toupper() and _tolower(), and the C library has
code which implement toupper() and tolower() in the more desirable
way that checks before changing.

The system III way is definitely nicer to use, but if you have to worry
about compatibility with v7 and Berkeley, you better stick to the
"if ( islower(c) ) ..." way of doing things.  I spent a lot of time
tracking down bugs caused by these kind of incompatibilities about
a year ago, and it sure wasn't fun.  Does the System III -> System V
transition go a lot smoother than the v7 -> system III?  I sure hope
so.

	Jim Reuter
	(decvax!cincy!jreuter)



More information about the Comp.lang.c mailing list