View Single Post
Join Date: Nov 2008
Posts: 43
Reputation: davids2004 is an unknown quantity at this point 
Solved Threads: 0
davids2004 davids2004 is offline Offline
Light Poster

Re: How can I add a loop for this code

 
0
  #4
Dec 1st, 2008
Originally Posted by cikara21 View Post
Simply..
  1. //...
  2. char rep='n';
  3. //display the menu and get user's choice
  4. while(tolower(rep)=='n')
  5. {
  6. //...Menu
  7. cout<<"repeat? [y/n] : ";
  8. cin>>rep;
  9. }
  10. return 0; //bye..
Thanks for the help. Would I put that before the else if part of the code? Also the char rep='n'; needs to go at the top where I clarify everything. Also what would I do if I wanted it to either be a capital or lower case y or n?

Thanks.
Reply With Quote