i need to know how to create a simple menu in C that allows the user to pick from 12 options
cheers
i need to know how to create a simple menu in C that allows the user to pick from 12 options
cheers
Display your twelve items. Read input. Do something.
Quzah.
Hope is the first step on the road to disappointment.
Well, I think we're going to need a few more details, such as the intended user interface platform. How to construct the menu will vary quite a bit depending on if your menu should run from a command-line, or in a Windows GUI, or in an embedded device.
Code:int choice; do { printf("Please make a choice: \n" "1) Option One \n" "2) Option Two \n" "3) Option Three \n" "4) Option Four \n" "5) Exit \n"); scanf("%d", &choice); if (choice == 1) {} else if (choice == 2) {} else if (choice == 3) {} else if (choice == 4) {} else if (choice == 5) {} else { printf("Invalid Choice"); } } while (choice != 5);Something tells me that's not what he's looking for.Originally Posted by KidA
Sent from my iPadŽ
it is in a windows GUI
So make an attempt at it. Surely you have enough experience programming to give it a decent try. Look for some graphics libraries online and read the documentation.
Sent from my iPadŽ
We're getting closer! Now, what environment are you using? Are you using an IDE where you can quickly build a form using a graphic editor, or are you intending to code it manually through your source?Originally Posted by whitey82
If you're using an IDE such as Visual Studio or C++Builder, you should be able to find many tutorials on this very topic.
If you're intending to code it manually, scrap that idea and get an IDE. Or, try searching the Windows Programming forum...
"So I was sitting in my cubicle today, and I realized, ever since I started working, every single day of my life has been worse than the day before it. So that means that every single day that you see me, that's on the worst day of my life" - Peter Gibbons
im intending to create it using the iDE borland C++
We can't really help you (I can't help at all if it's graphical. ) with these one line discriptions of your program. You have to give details. What kind of graphics do you want it to have? Are you looking for clickable options, do you want them to type it in a text box?
Sent from my iPadŽ
sorry, its just a plain interface that will let the user enter a number from one to twelve which will represent one one the twelve options. This could be done using a option box. yes.
Borland C++Builder? Good choice!
There is actually a Text Editor tutorial included in the online help for C++Builder...also check out: http://www.programmershelp.co.uk/c++builder.php.
"So I was sitting in my cubicle today, and I realized, ever since I started working, every single day of my life has been worse than the day before it. So that means that every single day that you see me, that's on the worst day of my life" - Peter Gibbons
Cheers