cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/10/18:17:31

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: <Pine DOT SOL DOT 3 DOT 91 DOT 980803094454 DOT 23337A-100000 AT mercury>
NNTP-Posting-Host: mpl9-74.abo.wanadoo.fr
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


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