Primary expression error

Hello everyone i need assistance. Im getting a primary expression error on the 11th line, and i dont know how to fix it. Please help me

include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
using namespace std;
void PrintPurpose();
int GradeMCExam(string keys, string answers);
int main()
{
PrintPurpose();
GradeMCExam(string keys, string answers);(RIGHT HERE IS WHERE IM GETTING THE ERROR)
return 0;
}

void PrintPurpose()
{
cout<<"The purpose of this program is to grade answers"<<endl;
}

int GradeMCExam(string keys, string answers)
{
ifstream inFile;
string fileName;
cout << "Please enter the name of your file name :";
cin >> fileName;
inFile.open(fileName.c_str());
if (!inFile)
{
cout<< "File does not exist"<< endl;
}
else
{
cout<<"Please try again"<<endl;
cin>>fileName;
return 0;
}
}
and if i remove the semicolons it gives me an error : expected initializer before 'int'
You need to actually supply arguments to the function, not restate what the argument types and names are.
You have to give arguments for the function. Just restating what the types are and such achieves absolutely nothing.

Edit: L B beat me to it.
Last edited on
Topic archived. No new replies allowed.