[prog] c types confusion

dominik.schramm at gmxpro.net dominik.schramm at gmxpro.net
Wed Mar 24 16:27:04 EST 2004


"Kathryn Hogg" <kjh at flyballdogs.com> writes:

> dominik.schramm at gmxpro.net said:
>> [...] The size of signed int is 4 bytes, or 32 bits,
>
> The size of an int isn't guaramteed to be any particular size only that
> its at least as big as a short and no bigger than a long.  Depending on
> the architecture, it could easily be 16, 32, or 64 bits.  But it is
> actually 32 bits on most systems these days.

yes, right, but I thought we had established that ints are 4 bytes long
in *this* case.

I should have said (and that's what the C standard guarantees):

sizeof(signed int) == sizeof(unsigned int) == sizeof(int)

dominik



More information about the Programming mailing list