tolower/toupper (ctype) standard

Steve Sanderson san at ut-sally.UUCP
Mon Dec 5 13:04:50 AEST 1983


On some implementations, tolower/toupper returns a non-alphabetic
character if their argument is already lower/upper.
I have heard differing opinions that:

	1) the case of the letter should be checked before using
	to????? to change to the opposite case.
or
	2) that the case should be checked within to?????, and nothing
	done if already in the proper case.

Granted that it makes little difference, both ways are easily accepted,
but... has any consensus been reached as to which is ``more standard''?
I prefer #2 simply because it puts more work someplace else.
I've run across this issue countless time when porting code,
If you aren't checking case, and neither are the to????? routines,
you end up with some surprises!


	Steve Sanderson

	ut-sally!san
	san at ut-sally.UUCP



More information about the Comp.lang.c mailing list