What does the C++ compiler error "looks like a function definition, but there is no parameter list;"
- by SkyBoxer
#include <iostream>
#include <fstream>
using namespace std;
int main
{
int num1, num2;
ifstream infile;
ostream outfile;
infile.open("input.dat");
outfile.open("output.dat");
infile >> num 1 >> num 2;
outfile << "Sum = " << num1 + num2 << endl;
infile.close()
outfile.close()
return 0;
}
This is what I did and when I compile it, I got this error that said
error C2470: 'main' : looks like a function definition, but there is no
parameter list; skipping apparent body
Please don't hate me :( I am new at this computer science....