mardi 12 juillet 2016

Extracting values from a file's universal hexidecimal notation

I'm not sure if there is already similar to this; anyways, here's my problem.

I have been tring to read the data of an int or float from part of a file which its content can be viewed as an array of hex bytes (in which I think basically all computer files can).

For example, I would like to read the integer of triangle number from the 81th to the 84th bytes of an .stl file; these particular hex bytes might looks like this:

enter image description here

Using C++, how can I do this with the most efficient method? Am I to use fstream? If so, how?

Aucun commentaire:

Enregistrer un commentaire