delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/01/02:45:44

Date: Tue, 1 Jun 1999 09:43:16 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Nate Eldredge <nate AT cartsys DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: typedef'ing a 24-bit integer
In-Reply-To: <375330BD.BEEE777@cartsys.com>
Message-ID: <Pine.SUN.3.91.990601094257.19912L-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 31 May 1999, Nate Eldredge wrote:

> Miguel Guerreiro wrote:
> > Perhaps I didn't make myself clear, I only want it to take three bytes
> > when I save it to disk ( maybe packed ) not while I'm working with it...
> 
> So just use `int', and write it like:
> 
> putc(x);
> putc(x<<8);
> putc(x<<16);

...and don't forget to switch stdout to binary mode (e.g., with
`setmode') before you do the above.

- Raw text -


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