It will not compile. The compiler is not highlighting errors. Is this normal?
It is giving me messages of line 771 and 559 and so on. The code can't be more than 50 line? Any ideas?
system("PAUSE");
return EXIT_SUCCESS;
}
void get_file (ifstream &fin, ofstream &fout)
{
char in_file[40], out_file[40];
cout << "What is the name of the file containing data to be analyzed?\n";
cin >> in_file;
fin.open("in_file");
if (fin.fail())
{
cout << "Input file failed.\n";
exit(1);
}
cout << "What is the name of the file where you would like to store data?\n";
cin >> out_file;
fout.open("out_file");
if (fout.fail())
{
cout << "Input file failed.\n";
exit(1);
}
}
I have no idea what you were trying to do, but you have a few errors like
fout.open("out_file");
Your description sounds like it maybe was a template instantiation error, but without giving us the the exact error we can't help you (at least not me as I'm too tired for this).
The compiler is not highlighting errors. Is this normal?
A compiler isn't supposed to highlight anything, so I'd guess so.
I am trying to get from the user and open a file to read from and a file to send to.
In the past when I were to push Compile and Run, the line of the first error would light up. I would work on that error and press compile and run again and the next error would highlight. It is no longer doing this. It is simply giving me messages of lines. some from lines that don't exist in the code.
Because "in_file" is the string "in_file" rather than the variable in_file you declared earlier. It's a logical error rather than a syntactical one. And again, we can't help you without you telling us what your error message is. Preferably also what compiler you're using.
Oh, and it may be helpful for you if you'd read up the difference between a compiler and an IDE, it seems as if you're mixing the two up.
VS 2010 initial sense highlights the errors while your typing the code. It is initial sense, not compiler.
P.S. Initial sense starts failing when project gets bigger. Rebuilding helps, but only temporary, so dont put too much hope on it.