Greetings,
I'm working on a accessor method for my class MobileRobot.
The method location() should return a r_val pointer to a Coordinate.
location_ is a protected member of MobileRobot class. With that said I am unsure why I'm receiving the following error.
ERROR: invalid use of 'this' in non-member function //see line 3
Upon removing 'this->' from line 3 I am met with a new error.
ERROR: 'location_' was not declared in this scope
If anyone can help me understand how I have misused 'this->' or my scoping error, it would be greatly appreciated.
Thank you for your assistance! Scoping has been giving me quite a bit of trouble.
Your solution solved my issue here, and you where correct about r_val being part of the assignment.