Returning To A Menu

Hi, so I have a program which adds objects to a Linked List after selecting an option from a menu.
Looks a little like this:

1
2
3
  Menu::myMenu(){
  //MENU OPTIONS ETC IN HERE
}


How would I go about returning to this menu from another page without creating a new instance using: Menu* Display = new Menu();

Last edited on
I'd be interested in seeing the entire program.
Can you provide a link to a zip?
I can show you the program, have a discord? Its an assignment so wouldn't be able to upload publicly until its handed in and marked unfortunately.

Happy to share the whole system once iits marked etc. I don't know why I'm struggling with something so simple.
Hello UKSeanJ,

If you make the menu a stand alone, regular, function and not part of a class you can call the function at any time from any place in the program.

Otherwise you may have to pass an instance of the class to different functions.

Andy
Can you at least give more detail about Menu?
What do you mean by "another page"?

It's possible that the Menu member functions could be made static and then you wouldn't need an instance to call them. Does menu have any member data?
Last edited on
Topic archived. No new replies allowed.