I have a doubles binary that I need to load using C ++. However, my problem is that it was written in capital letter format, but the fstream → operator then reads the number incorrectly, because my machine is insignificant. Apparently, a simple task for solving integers, but for paired and floating solutions that I found will not work. How can I (or should I) fix this?
I read this as a reference for integer byte exchange:
How to convert big-endian and little-endian values to C ++?
EDIT: Although these answers are enlightening, I found that my problem is with the file itself and not with the binary data format. I believe my byte exchange does the work, I just get confusing results. Thank you for your help!
source
share