delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/03/02/09:00:13

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: 16 bit integers
Date: 2 Mar 2004 13:54:05 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 19
Message-ID: <c223lt$18v$1@nets3.rz.RWTH-Aachen.DE>
References: <baec0bf0 DOT 0403012323 DOT 10896c3 AT posting DOT google DOT com> <esd840d8dde7matafu4vd11bsvagshadkl AT 4ax DOT com> <baec0bf0 DOT 0403020529 DOT 8f42598 AT posting DOT google DOT com>
NNTP-Posting-Host: ac3b07.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 1078235645 1311 137.226.33.205 (2 Mar 2004 13:54:05 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 2 Mar 2004 13:54:05 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Andrey <huli_ebtyt AT list DOT ru> wrote:
> And what if I want to process an array of 16-bit data loaded from a file,
> should I use?:

> a = *(pointer)&0x0000ffff;
> b = *(pointer)>>16;
> ...
> work with a, b
> ...

Use short (or unsigned short) values.

This is your personal reminder of why putting binary data directly
from C into files and back has always been a questionable idea at
best.

-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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