delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/03/12:48:51

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: <Ex40Ez.4rK@fcshome.stoneham.ma.us>
References: <Pine DOT SOL DOT 3 DOT 91 DOT 980803094454 DOT 23337A-100000 AT mercury>
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

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) -----------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019