Date: Thu, 8 Oct 1998 20:29:35 +0100 (BST) From: George Foot To: djgpp AT delorie DOT com Subject: Re: simple question :) In-Reply-To: <6vdrif$ipb$1@nnrp1.dejanews.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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