View Single Post
Join Date: Nov 2008
Posts: 19
Reputation: bionicseraph is an unknown quantity at this point 
Solved Threads: 6
bionicseraph bionicseraph is offline Offline
Newbie Poster

Re: Big looping problem in C - help

 
0
  #5
Nov 4th, 2008
The problem is that your outer loop is checking for 0 to exit. So when you have an error condition you are exiting the loop. Is there a char you enter to exit the program? That's the value that you'll want to use in that loop. I think you'll want to do something like this...
  1. while(c != SENTINAL){
  2. if(c == 0){
  3. PrintIt("error must be 1-4");
  4. continue;
  5. }
  6. //other loop code
  7. }
SENTINAL is the value the user enters to exit your program
Reply With Quote