Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

endian independent file io in C++

Name: Anonymous 2007-02-24 21:45 ID:XOqzVx8R

What is the correct way to do this?  I'm doing:

data->put (x % 256);
data->put (x / 256);

and

x = data->get ();
x += data->get () * 256;

But I'm sure there's a better way.  Also, this way doesn't work with negative numbers.

Name: Anonymous 2007-02-26 1:30 ID:DwjDL1Ru


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List