From: abde AT wanadoo DOT fr Newsgroups: comp.os.msdos.djgpp Subject: Re: How to make DJGPP treat an int as 16-bit in size. Date: Mon, 10 Aug 1998 21:15:49 GMT Organization: Wanadoo - (Client of French Internet Provider) Lines: 29 Message-ID: <35cf5c6b.2289896@news.wanadoo.fr> References: NNTP-Posting-Host: mpl9-74.abo.wanadoo.fr To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Mon, 3 Aug 1998 09:50:26 +0800, Goh Yong Kwang 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