I have to use this header and I'm pretty sure it means that it returns a pointer to the object?
Here is the header for the method I have to write.
MenuItem *findItem(string code);
Here is the cpp file part
MenuItem Menu::*findItem(string code)
Here is how I access the method.
MenuItem *tempMenuItem = myMenu.findItem("A3");
When I try to access the objects variables(numItems) with the *in front of the method it gives.
Menu.cpp: In function ‘MenuItem Menu::* findItem(std::string)’:
Menu.cpp:22: error: ‘numItems’ was not declared in this scope
Any reason why I can't access the variables? I can do so fine without the * in front of the method name.