Hi i'm having a problem using ifstream. I'm reading from a .dat file which contains 1's and 0's but nothing seems to be coming from the stream, my code is below:
Thanks, I tried changing the walkability array to an integer array, and now i get a big line of zero's. The problem is that its not reading the data properly, there should be a bunch of one's in there as well. I should mention that myTerrainData.dat can only be edited in a hex editor, it shows as a bunch of null characters in a normal text editor.
Is the data file an ascii file or a binary file? If it's binary, you will need to open the ifstream with the std::ios_base::binary flag. Then you'll read the data 1 byte at a time using get().
Also, what is the data type of the walkability array?