I'm trying to use a simple map writen in a txt file in my game but I can't get it to work.
I have an array of integers: int iMap[10][10];
And then I read in numbers from a txt file useing for loops and useing iMap[x][y] = fin.get()
Here's my problem; When reading the file like this it puts all tbe '/n' in the array as well so I have to have the whole map on one line in the txt file. I would like to have it 10 by 10 in the file as well. How can I tell fin.get() to ignore all linebreaks in the txt file?




Reply With Quote