I have looked everywhere and can't for the life of me find exactly what I'm looking for.
I'm trying to write a load of unsigned integers to a binary file, the problem is I can only find how to write characters. That isn't a binary file really, I would like to store just 32-bits for each uint.
ofstream.write() requires a character array, if I typecast my uint to (char*) it reverses the order so the number (in hex) 04004000 is written as 00400040.
How nuts is that.
I'm also having a problem reading these files properly, I have written a Java version of my program which works perfectly except it doesn't support unsigned integers so I'm stuck with 64-bit numbers. I can't seem to load the numbers one at a time using c++

I'm trying to write a load of unsigned integers to a binary file, the problem is I can only find how to write characters. That isn't a binary file really, I would like to store just 32-bits for each uint.
ofstream.write() requires a character array, if I typecast my uint to (char*) it reverses the order so the number (in hex) 04004000 is written as 00400040.
How nuts is that.
I'm also having a problem reading these files properly, I have written a Java version of my program which works perfectly except it doesn't support unsigned integers so I'm stuck with 64-bit numbers. I can't seem to load the numbers one at a time using c++
