T
Tanuki
Hi All:
I encounter a programming problem recently. I need to read a binary
file. I need to translate the binary data into useful information. I
have the format at hand, like 1st byte = ID, next 4 byte (int) =
serial number etc.
The first problem is Big Endian/ Little Endian problem. I can decipher
if the format is big or little endian. But got confuse as to how to
decipher the data.
Eg. if I know I am on little endian, and I have a integer whose binary
representation is
20 03 00 00, then what is the equivalent decimal?
The next problem is there are also floating point data. How can I
infer the floating point data from a binary representaiton, like what
r the numbers before the decimal point and those after the decimal
point?
I hope I am not too confusing. Any help gladly appreciated. BTW, my
language is C/C++
I encounter a programming problem recently. I need to read a binary
file. I need to translate the binary data into useful information. I
have the format at hand, like 1st byte = ID, next 4 byte (int) =
serial number etc.
The first problem is Big Endian/ Little Endian problem. I can decipher
if the format is big or little endian. But got confuse as to how to
decipher the data.
Eg. if I know I am on little endian, and I have a integer whose binary
representation is
20 03 00 00, then what is the equivalent decimal?
The next problem is there are also floating point data. How can I
infer the floating point data from a binary representaiton, like what
r the numbers before the decimal point and those after the decimal
point?
I hope I am not too confusing. Any help gladly appreciated. BTW, my
language is C/C++