It compiles, thanks. But it doesn't really seem to work, so let me just ask another question if I may. :-)
I'm using an ifstream to read from an archive file, like this:
archive.open(filename, ios::in | ios::ate | ios::binary);
size = archive.tellg();
archive.seekg (0, ios::beg);
archive.readsome(reinterpret_cast<char*>(&buffer), 4);
somedata = buffer;
archive.close();
Sometimes it works, but sometimes it gives some strange results.
Example:
I read 4 bytes with readsome, and the result is: 872808448
When I check those 4 bytes on the file with a hex editor I see: 00 00 06 34 (Should be 1588)
And when I shift 24 bits to the right I get: 52... Which I can figure out why if you take only the 34 from the 00 00 06 34, you get 52. (00 00 00 34)
I have no idea how this works!? Thanks alot!