Identifier not found

Apr 25, 2013 at 3:58pm
Forgot to scope!
Last edited on Apr 25, 2013 at 4:14pm
Apr 25, 2013 at 4:13pm
That code you've posted from the cpp file isn't defining methods of the class. It's defining global functions.

You define a method like so:

1
2
3
4
bool MyClass::MyMethod(int a, double b)
{
  // ...
}
Apr 25, 2013 at 4:14pm
Oh lord this was so stupid.
The rest of the code is using scope, but since I copied that from old code I forgot to scope it... jeez thanks mate
Apr 25, 2013 at 4:16pm
No worries - it's an easy mistake to make :)
Apr 25, 2013 at 4:26pm
Solved :)
Last edited on Apr 25, 2013 at 5:15pm
Apr 25, 2013 at 4:43pm
Best guess, it needs an object of type Line to call it.
Apr 25, 2013 at 4:46pm
operator>> is a global operator, rather than part of the class. Presumably, you want to call ln.requestInput ?
Last edited on Apr 25, 2013 at 4:50pm
Apr 25, 2013 at 5:15pm
You are absolutely right MikeyBoy, had no idea that could happen, I assumed it would be handled as if it was a part of the class.
Topic archived. No new replies allowed.