have error:
main.cpp:68:44: error: invalid initialization of reference of type ‘std::istream& {aka std::basic_istream<char>&}’ from expression of type ‘std::istream* {aka std::basic_istream<ch
ar>*}’
while( (tok = getNextToken(in, &lineNumber)) != DONE && tok != ERR ) {
We can see that 'in' is a pointer: istream* in;
We can't see the declaration of getNextToken(), but it probably has: getNextToken( std::istream&, int* )
Simplified example:
1 2 3 4 5 6 7 8 9
void foo( int& x ) {
x = 42;
}
int main() {
int bar = 7;
int* gaz = &bar;
foo( gaz ); // error: cannot initialize reference from pointer
}
Syntactically, this probably is acceptable: getNextToken( *in, &lineNumber )