Mail Archives: djgpp/1998/08/10/18:17:31
On Mon, 3 Aug 1998 09:50:26 +0800, Goh Yong Kwang
<s6606555 AT mercury DOT np DOT ac DOT sg> wrote:
>
>I have some binary data files that are generated by a 16-bit DOS program
>which treat an int as 2 bytes.
>
>Now I want to use DJGPP to write a program to read them but DJGPP thinks
>that an int should be 4 bytes (32-bits) huge.
>
>The difference in size of int will cause the program to read the data
>files incorrectly. Is there any easy way to make DJGPP treat int as 2
>bytes?
>
>Thanks in advance!
>
>----------------------------------
>Many regards,
>Goh Yong Kwang
>96606555
>3K
>----------------------------------
>
I think that you perhaps can try type 'short'.
Or read those 2 bytes as chars then after you can 'cast' them to int
(4 bytes) byte by using an int pointer
- Raw text -