I am doing this for a class project. We are supposed to open a data file p6.dat and read the data which includes 15 scores (3 tests, 5 students). I am getting an error online 20 from the compiler. Could anyone direct me as far as what I can do to fix this? Thank you!
for (int x = 0; x < NumbofStudents; x++)
{
for (int y = 0; y < NumbofTests; y++)
{
if (Scores[x][y] > highest)
highest = Scores[x][y];
if (Scores[x][y] >= 90)
++numbofAs;
}
}
cout << "The best score was: " << highest << endl;
cout << " There were " << numbofAs << " total A's." << endl;
system("pause");
return 0;
}
This is the error message:
ajanch8project.cpp: In function `int main()':
ajanch8project.cpp:20: error: no matching function for call to `std::basic_ifstream<char, std::char_traits<char> >::open(std::string&)'
/usr/local/gcc3/bin/../lib/gcc/sparc-sun-solaris2.8/3.4.5/../../../../include/c++/3.4.5/fstream:570: note: candidates are: void std::basic_ifstream<_CharT, _Traits>::open(const char*, std::_Ios_Openmode) [with _CharT = char, _Traits = std::char_traits<char>]
I am assuming it has something to do with not being able to open the file, but I am not sure how to fix. Any assistance would be appreciated. Thank you!