K
Keith Thompson
santosh said:Keith Thompson wrote: [...]Others have pointed out the redundancy of the isalpha() and isupper()
calls.
I knew that isupper() is redundant, but I retained it just to keep the
logic of the routine straightforward, (a tolower() on it's own would
need additional explanations to the OP).
IMHO it's an explanation that's well worth making. If you're going to
use tolower(), you should understand how it works; part of that is
understanding how it behaves with arguments for which isupper() is
false. (It's certainly easier to understand than the need (sometimes)
to cast the argument to unsigned char.)