characters
Karl Heuer
karl at haddock.ima.isc.com
Tue Sep 25 09:59:13 AEST 1990
In article <459 at taumet.com> steve at taumet.com (Stephen Clamage) writes:
>The best option is not to write code which depends on the signed-ness of
>chars. The primary error is writing code which uses chars as tiny
>integers [which can be fixed by using ints or something]
It turns out to be harder than one might suppose, even for programs that don't
have that problem. Consider the case typified by `if (getchar() == *s++)':
a successful getchar() always returns a zero-extended value, but `*s++' may do
sign extension if `s' was declared `char *'.
Karl W. Z. Heuer (karl at kelp.ima.isc.com or ima!kelp!karl), The Walking Lint
More information about the Comp.lang.c
mailing list