Mail Archives: djgpp/2000/05/09/06:20:18
Jared Stevens <stevja AT lineo DOT com>:
> Hello -
> In DJGPP, since it's a 32-bit compiler, when I make a
> variable of type
> char,
> does it store that variable in a 32-bit slot in
> memory, or an 8-bit slot? I
> heard somewhere that when you make a variable if it
> is smaller than 32
> bits, it
> will store it in a 32 bit slot. If it does do this,
> is there a way to make
> it
> store a char in an 8-bit slot and an int in a 16 bit
> slot?
AFAIK It is possible to use the minimal storage only
when dealing with fields in struct's. You can use
the "#pragma pack(1)" directive or use
"__attribute((packed))__" when declaring such structs.
Look at FAQ 22.11 for more details on this topic.
BTW, be warned that since gcc is a 32 bit compiler the
size of an integer is not 16 bit, but 32. If you need
16 bit integers you have to use "short int".
ciao
Giacomo
------------------------------------------------------
Giacomo Degli Esposti - pad2369 AT iperbole DOT bologna DOT it
- Raw text -