Reading hex offsets/data from ifstream file?

Hello. Can anyone tell me if it is possible to read a hex offset such as
0x00000001
(0x1??)

Like in a hex editor???

Ummm... I guess that's my question. Thanks. :D
Last edited on
yes, use a hex editor or display tool (od -x on a linux system).
Be aware that x86 systems are "little endian" which means they store the least significant byte first. So an offset like 0x12345678 when viewed in a file will be 78 56 34 12
Oh, I meant a way to get a file offset using c++?
1
2
int offset;
mystream.read((char*)&offset, sizeof(offset));   // if the offset is binary 

or
mystream >> offset; // if the offset is literally the characters 0x00000001
Topic archived. No new replies allowed.