Mail Archives: djgpp/1996/04/29/04:18:08
That's because that's how it's down in Unix. It is not true that an "int"
is always 16-bits long. ANSI C specifies that a long is AT LEAST the size
of an int, not necessarily longer.
To use a 2-byte int, use "short int"
On 28 Apr 1996, Nicholas Lynch wrote:
> I was having some trouble using a structure to load a file header in DJGPP.
> I found that it worked in borland C no problem. So, I wrote a little test
> program that would give me the sizes of several data types:
>
> Borland C/C++:
>
> Variable Size
> ---------------------
> int 2
> unsigned int 2
> long 4
> ...
>
> But in DJGPP:
>
> Variable Size
> ---------------------
> int 4
> unsigned int 4
> long 4
> ...
>
> Is there any way of correcting this? (I belive that this problem cropped up
> earlier in thee newsgroup, but I didn't save the solution :( Or, should I
> just use a different data type instead of int?
>
> Thanks in advance...
> --
> O Nicholas Lynch
> -|- br516 AT freenet DOT carleton DOT ca
> / \
>
- Raw text -