View Single Post
  #4 (permalink)  
Old June 12th, 2006, 01:41 AM
Alan-LB Alan-LB is offline
Authorized User
 
Join Date: Mar 2005
Posts: 58
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to Alan-LB Send a message via Yahoo to Alan-LB
Default

Your statement
"while((response!='y')||(response!='n'))"
says while response is not equal to 'y' OR response is not equal to 'n' - this will cause an infinite loop since the condition will always be true!

Change the OR (||) tp AND (&&)

After the second "cin >> response;" put "response = tolower(response); then the second while statement becomes "while (response == 'y');"

Alan




Reply With Quote