So i have a program which reads the input out of a specific .txt file. The code is:
void Image::get_image_dimensions(char *fname)
{
// determine the number of entries in image
ifstream fin(fname);
fin >> num_rows ;
fin >> num_columns ;
cout << "...reading from file " << fname << endl;
cout << "File has " << num_columns << " rows and "<< num_columns << " columns" << endl;
fin.close();
}
the method is called inside the main. After I compile the program with VS2010 and run the code everything works properly. But after if I go to the Debug folder of my program and run my program from there it doesn't read the input anymore, and crashes...
What might be the problem?