Character constants

Henry Spencer henry at utzoo.uucp
Sat Mar 4 02:29:05 AEST 1989


In article <7447 at pyr.gatech.EDU> curci at stat.fsu.edu (Ray Curci (scri)) writes:
>A simple printf("%d", sizeof('x') ); reveals that a character constant
>(at least both on sun3 and ultrix 11/780) are the same as an int (4 chars).
>Isn't it a lot easier to execute a simple test program than to try to
>look up this type of information?

Unfortunately, executing a test program just tells you what your compiler
thinks the answer is.  That doesn't mean it's right.  Quite apart from
compiler bugs, which definitely exist, there has been some divergence
among C compilers over the years.  It will be quite a while before all
compilers comply with the ANSI standard, even in theory.
-- 
The Earth is our mother;       |     Henry Spencer at U of Toronto Zoology
our nine months are up.        | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list