TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Auke Reitsma
from: Neil Heller
date: 1998-08-23 09:30:00
subject: BIG VS LITTLE ENDIAN

AR> For the 'other' system it should be the other way about. So
AR> assuming you get each new byte with a call to the function
AR> new_byte() you could do:
AR> 
AR>   long val = 0
AR>   val += new_byte();
AR>   val *= 256;
AR>   val += new_byte();
AR>   val *= 256;
AR>   val += new_byte();
AR>   val *= 256;
AR>   val += new_byte();

Would it be quicker in this situation to shift the bits, or does this
make the entire construct less portable?

 * KWQ/2 1.2i *

--- FLAME v1.1
* Origin: Port Chicago's Loading Dock - 510-676-5359 (1:161/204)
SEEN-BY: 396/1 622/419 632/371 633/260 267 270 371 634/397 635/506 728 810
SEEN-BY: 639/252 670/213 218
@PATH: 161/204 42 215/34 270/101 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.