When I use the WriteInt function it actually writes something extraneous at the beginning of each data portion I write.
So if I do this:
File *output = File.Open("test.txt", eFileWrite);
output.WriteInt(5);
output.Close();
And then load the output file in Hexedit, I see this:
49 05 00 00 00 I . . . .
How can I get rid of it? Why is it there?
The 'I' is there to indicate to the ReadInt function that indeed the value written to the file was an Int.
Unfortunately there doesn't seem to be a WriteRawInt function to correspond to ReadRawInt.
You could simulate it with WriteRawChar, like so:
function WriteRawInt(File *output, int intToWrite)
{
Ã, output.WriteRawChar(intToWrite & 255);
Ã, output.WriteRawChar((intToWrite>>8) & 255);
Ã, output.WriteRawChar((intToWrite>>16) & 255);
Ã, output.WriteRawChar((intToWrite>>24) & 255);
}
Success! I've never been happier. It's 12:33 AM and I finally finished this project I've been struggling with.
Thank you everyone for your emmense help!