Menu based console applications

Any good tutorials or books for menu based console application?
Thanks Janlan
Just leave the console. If you want a GUI, use qt, gtk, wxwidgets, etc.
I have project to make application with menu in console :)
If you must..
Though I don't understand what exactly you are looking for. The best way to structure console menu? Tools you can use when abusing the console?
Below is what I think you are looking for, which is a menu that can be integrated into a console application. Setup a loop in your main function that lasts forever and constantly calls this menu and then customize the menu however you want.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
void PrintMenu()
{
	int myChoice = 0;
	
	std::cout << "********** Main Menu **********" << std::endl;
	std::cout << "(1): Option 1" << std::endl;
	std::cout << "(2): Option 2" << std::endl;
	std::cout << "(3): Option 3" << std::endl;
	std::cin >> myChoice;
	
	switch(myChoice)
	{
	case 1:
		FunctionOne();
		break;
	case 2:
		FunctionTwo();
		break;
	case 3:
		FunctionThree();
		break;
	default:
		std::cout << "ERROR! You have selected an invalid choice." << std::endl;
		break;
	}
}
Last edited on
Is it something like the BIOS menu on your computer or the menu whether to boot in safe mode or not you want to copy the idea of?

Like in this image?
http://www.cooperation-iws.org/wiki/images/6/64/Bios-menu.gif
@GisleAune Yep, exactly like that :)) any good tutorials or books? :)
you could definitely use ncurses to generate something like that on a *nix box, but I wonder what's the standard library for a Windoze box - is there something in the DOS API?

but this is BIOS - something even lower level must be used - assembly? what's embedded onto the ROM?

got me all curious now...
Last edited on
Both curses -- ncurses and PDcurses -- are available for Windows, IIRC. At the very least, I know PDcurses is.
The WinAPI has console-specific functions.

He said he wants something like the BIOS menu in his program, not that he's going to overwrite the BIOS with his own code.
yup, I know... ...I was just curious what code most BIOS actually use 8')
Nobody huh? :)
Topic archived. No new replies allowed.