C++ question and advice?

  • From: Jes <theeternalkid@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Sun, 25 Jul 2010 18:02:44 -0400

Hi all,

If I instruct a user to enter a choice from a menu, and they enter an invalid 
response, how do I display the menu of choices again without retyping the cout 
statements? For example,
cout << "Please select your favorite candy:
1. Snickers.
2. Baby Ruth.
3. Milky way. ";

If the user entered number 4,
How would I print the menu again without typing all those statements?
And, can somebody explain to me the difference between the do while, and while 
loops?
Thanks.
Jes

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

Other related posts: