Okay, so I have a program that read integers from a file and stores them in an array. The relevant code:
readLevel.open("level.txt");
if((readLevel.is_open()))
{
for(int rows = 0;rows<=BLOCKROWS-1;rows++)
{
for(int cols = 0;cols<=BLOCKCOLUMS-1;cols++)
{
blocks[rows][cols] = readLevel.get();
}
}
}
However, here's the trouble. Instead of reading the value I want into the array, instead it read the ascii code. In other words, instead of reading 0 into the array, it reads 48. I've been trying for a good few hours to find some way for it to read the actual value from the file, but I'm at my wits end, so any help would be much appreciated.