I'm trying to understand your code, well, i've never worked on linked list but have an idea..
Could you explain the purpose of this function pointer menufunc & class menucontext? Expanding to that, how/for what reasons it's used here in"domenu"?Code:// Class menucontext class menucontext { public: bool fquit; menucontext() : fquit(false) {} ~menucontext() {}; }; typedef void (*menufunc)(menucontext &ctxt);
Code:for(p = head; p; p = p->next) { if (p->item->isChoice(c)) { p->item->domenu(ctxt); choosen = true; } } ............. void menuitem::domenu(menucontext &ctxt) { func(ctxt); }