X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Hans-Bernhard Broeker 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: References: 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 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.