This is a doubt that i had from a long time.
First:
a char, is it always one byte? or does it vary?
Second: Is there any way to declare a type, say int32, that it's always a 32-bit integer on any architecture?
Thank you.
This is a doubt that i had from a long time.
First:
a char, is it always one byte? or does it vary?
Second: Is there any way to declare a type, say int32, that it's always a 32-bit integer on any architecture?
Thank you.
It is always one byte, yes. But the language allows that a char/byte be defined at least 8 bits if not more.
In C99 such things are available but optional, as intN_t. They may be found in <stdint.h>.
See also 7.18.1.1.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
Too slow :P
^^
Last edited by stickmangumby; 06-04-2007 at 08:53 PM. Reason: see Dave_Sinkula's post above for answer