[prog] c types confusion

dominik.schramm at gmxpro.net dominik.schramm at gmxpro.net
Wed Mar 24 19:42:15 EST 2004


Hi,

"Daniel." <cristofd at hevanet.com> writes:

>> It's true, of course, for any reasonable platform nowadays, but there's
>> nothing "guaranteed" in the spec about it.
>
> I got the information from K&R2 pg. 257, and all the websites I'm
> finding seem to agree. Anyone have something more reliable?

In K&R2 in the chapter "2.2 Data Types and Memory" (or similar; 
I have the German translation):

A compiler can arbitrarily choose "reasonable" sizes for the internal
representation of the basic data types, as long as "short int" and 
"int" are at least 16 bits long, "long" is at least 32 bits long
and sizeof(short) <= sizeof(int) <= sizeof(long).

regards,
dominik



More information about the Programming mailing list