in main I have
Menu *ptrBaseMenu = new MainMenu(library);
but this gives me the following error:
ain.cpp: In function `int main(int, char**)':
main.cpp:37: cannot allocate an object of type `MainMenu'
main.cpp:37: because the following virtual functions are abstract:
menu.h:12: virtual void Menu::process_option(int) const
but its not abstract here is my header file with the ovriden function from a pure virtual function of the abstract class menu
Code:#ifndef MAINMENU_H #define MAINMENU_H #include <map> using std::map; #include "book.h" #include "menu.h" class MainMenu:public Menu{ public: MainMenu(); MainMenu(map<string,Book> &); virtual void display_menu() const; virtual bool validate_option(int) const; virtual void process_option(int); void display_library(map<string,Book> *); private: map<string,Book> *ptrLibrary; }; #endif



LinkBack URL
About LinkBacks


