Newsgroups: comp.os.msdos.djgpp From: fredex AT fcshome DOT stoneham DOT ma DOT us (Fred Smith) Subject: Re: How to make DJGPP treat an int as 16-bit in size. Organization: None! Message-ID: References: Date: Mon, 3 Aug 1998 10:42:35 GMT Lines: 23 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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? No. But you could write the code that reads it to use type 'short' instead, then once you've got it into the short assign it to an int. Fred -- ---- Fred Smith -- fredex AT fcshome DOT stoneham DOT ma DOT us ----------------------------- "Not everyone who says to me, 'Lord, Lord,' will enter the kingdom of heaven, but only he who does the will of my Father who is in heaven." ------------------------------ Matthew 7:21 (niv) -----------------------------