How to get inheritance with argument?
So i'm trying to get a function called void MovieList::printTitle(string title) to be used in another class file, but when it comes to arguments it doesnt seem to work.
This is the function in MovieList.cpp
void MovieList::printTitle(string title)
for (it = list.begin(); it != list.end(); it++)
if (it->getTitle() == title)
cout << endl;
And i want to use it in usb.cpp inside a case where i have written
but it gives me a error saying title was not declared.
So you haven't declared or initialised title in usb.cpp. Do you realise this is not the same as the private title as in the class Film?
In usb.cpp, can you call list.printTitle with a literal string? Or initialise title with a literal string.
Topic archived. No new replies allowed.