hi there, could any of you pros help me out on how to start an menu-based console application using C++ functions? I dont think i'd be able to cope with OOD as im still new to c++. Not too sure on how to call out each function from the menu
Console menu
Collapse
X
-
Originally posted by JeremyThi there, could any of you pros help me out on how to start an menu-based console application using C++ functions? I dont think i'd be able to cope with OOD as im still new to c++. Not too sure on how to call out each function from the menu
We need a bit more to help - how are you trying to call the function from the menu now? -
Originally posted by sicarieAre you looking for something that involves Design Patterns? Is this supposed to be a GUI, or a text-based menu?
We need a bit more to help - how are you trying to call the function from the menu now?Comment
-
Originally posted by JeremyTThanks for the reply, it's supposed to be a text-based menu. It's supposed to be able to launch functions to find ID's, write new ID's and save new ID's as well.Comment
-
Try an infinite loop:
Code:while (1) { cin >> choice; case 1: Add(...); break; case 2: Revise(...); break; case 3: Exit(); return 0; }
Comment
-
Originally posted by JeremyTPretty much everything, kinda have no clue on how to code a menu :/
Do you have your functions created? Do you know how to call them? Have you tested them and know that they work?Comment
-
Originally posted by JeremyTPretty much everything, kinda have no clue on how to code a menu :/
1: first option
2: second option
etc.
then check what number the user entered and perform the correct function.Comment
-
Oops. forgot the switch
Try an infinite loop:
Code:while (1) { cin >> choice; switch(choice) { case 1: Add(...); break; case 2: Revise(...); break; case 3: Exit(); return 0; } }
Comment
-
Originally posted by weaknessforcatsTry an infinite loop:
Code:while (1) { cin >> choice; case 1: Add(...); break; case 2: Revise(...); break; case 3: Exit(); return 0; }
But as I said, that's personal preference, weaknessforcats ' method will certainly work.Comment
Comment