www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/08/18:28:26

Date: Thu, 8 Oct 1998 20:29:35 +0100 (BST)
From: George Foot <george DOT foot AT merton DOT oxford DOT ac DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: simple question :)
In-Reply-To: <6vdrif$ipb$1@nnrp1.dejanews.com>
Message-ID: <Pine.OSF.4.05.9810082028010.8766-100000@sable.ox.ac.uk>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Tue, 6 Oct 1998 jwright AT adtran DOT com wrote:

>   a = 12;
>   b = 18;
>   c = ( a << 16 ) + b;

You probably meant 8, not 16...

>   printf("\nCombine 12 and 18 to get %d,\n", c);
>   printf("  or in hex 0x%04X\n, c);

... otherwise the hex value won't show `a' at all (it's only 4
digits long).

> This converts two bytes to one integer.  Make sure you check endian
> for the CPU you will use.

What has the endianness got to do with anything?

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

xu do tavla fo la lojban  --  http://xiron.pc.helsinki.fi/lojban/lojban.html

- Raw text -


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