No overloaded function takes 0 arguments error

help, i am trying to write a program that takes in 9 number 1-9 from in.dat, reformat and output the numbers, but there was an error pop out stating "No overloaded function takes 0 arguments error" i been trying to soltion is problem but jus not able to. appreciate your help.

void Format::writeFile()
{
ifstream inFile;
ofstream outFile;

inFile.open("IN.dat");
outFile.open("OUT.dat");


if(inFile.fail())
{
cerr <<"ERROR: Cannot open one of both files! \n";
exit(1);
}


char lines[50];
int count = 0;
while(!inFile.eof())
{
lines[count] = inFile.getline(); // error pointing here
count++;
}

for(int i = 0; i < count; i++)
{
outFile << "Line "<< i+1 << " - " << lines[i];
outFile << endl;
}

inFile.close();
outFile.close();
}
]
You're not providing enough parameters for your getline() call. Perhaps you should find and review the documentation for this function.

Topic archived. No new replies allowed.