I think I understand how it's all done now, but my code disgrees with me completely. I have to pass the file pointers to other functions and they don't like t. Here's one example:
function declaration:
Code:
void SkipWS(ifstream inp);
the function:
Code:
void SkipWS(ifstream inp) // Skips white space and comments
{
int ch;
do
{
inp>>ch;
if (ch == '%') // Comment starts, read it to the end of line
{
do
inp>>ch;
while( ch != '\n' && ch != EOF);
}
else if (ch == '\n') // do not exit the loop at New Line
continue;
}
while (isspace(ch) && ch != EOF);
inp.seekg(-1,ios::end); // Pointer is left at the end of white space or comment,
// at the next char to be read
}
I get things like this:
Code:
'ifstream' : undeclared identifier
h:\gui\initial gui\bafparse.h(52) : error C2146: syntax error : missing ')' before identifier 'ptr'
'ifstream' : ambiguous symbol
h:\gui\initial gui\edfparse3.h(52) : error C2146: syntax error : missing ')' before identifier 'inp'
h:\gui\initial gui\edfparse3.h(52) : error C2182: 'SkipWS' : illegal use of type 'void'
h:\gui\initial gui\edfparse3.h(52) : error C2059: syntax error : ')'
and so on, 87 errors. I did include fstream in the header file before declaring the functions.
And the declaration gives an error
Code:
error C2501: 'streamoff' : missing storage-class or type specifiers
and there is a variety more of errors. I don't think it undestands the # include <fstream>