Is there a good example of how toupper() works?

John Stanley stanley at fozzie.UUCP
Sat Oct 20 07:41:57 AEST 1990


jackm at agcsun.UUCP (Jack Morrison) writes:
> 
> (or for anal types, :-)
> 	while (*duh != '\0') {
> 
   Or, for even less possibility for screw-ups:

	while ( '\0' != *duh ) {

The reason for the order becomes clearer in equality testing, when the
compiler will complain about ( '\0' = *duh ) and not ( *duh = 0 ). It is
real easy to catch a == vs. = problem this way.



This is my signature. It doesn't contain my name at all!



More information about the Comp.lang.c mailing list