Hello.
I'm planning to code a level editor for an old dungeon game, and thought it'd be nice to output the map file contents to the screen to see what's going on.
This results in the following output:Code:#include <iostream.h> #include <fstream.h> int main() { ifstream inFile; inFile.open("mod0.map"); // skip header inFile.seekg(56); unsigned char test; // output "map" of the corridor for(int count = 0; count < 24; count++) { inFile >> test; if(test < 10) cout << 0; cout << int(test) << ' '; } inFile.close(); return(0); }
02 04 00 00 00 00 00 00 00 00 06 06 00 00 00 00 00 00 00 00 06 04 203 06
Looking at the relevant section in the file using a hex editor gives:
02 04 00 00 00 00 00 00 00 00 0B 06 0B 06 00 00 00 00 00 00 00 00 06 04
Why is it missing the 0x0Bs out? The output I'd expect is:
02 04 00 00 00 00 00 00 00 00 11 06 11 06 00 00 00 00 00 00 00 00 06 04
Any ideas would be much appreciated. I know that 0x0B is a control code, but wouldn't casting it to an int make it display as 11? Thanks.