Game Development Community

File Input/Ouput

by Tom Muchouski · in Technical Issues · 11/15/2002 (10:25 pm) · 0 replies

I have a problem. Whenever I try to use ifstream to get the values for my array, each one becomes a ridiculous number (eg 28461947) when each value isn't allowed over 49. Here is my code:

void Load()
{
    ifstream file("File.dat");
    for(int i = 0;i < ARRAYSIZE;i++)
        {
        file >> Array[i];
        }
    file.close();
}
Before loading, I have made each value to 0 so... somewhere in the file >> Array[i] there is a problem.