title: return to the beginning of an if-statement in a loop
body: <p>I'm trying to create a simple game where the user has to go through a maze.  At the beginning of the maze, I give the user possible routes to take, and ask the user which route to take next.  If the user enters a correct route, I take him to the next route.  If the user enters a wrong route, I print an error message, followed by the prompt again, and read his input again.</p>
  
  <p>I'm having trouble figuring out what to do after I print the error message.  How do I go back to the beginning of the loop?  I did some research and am starting to think that I should use a do-while loop instead, but given the iterations in between (repeating this step until the user finds the exit of the maze), I struggle to figure out exactly how to do that. </p>
  
  <p>Here is my original if-else statement:</p>
  
  <pre><code>        printf("Prompt for user input\n");     //step1
          //user input                           
          scanf("%s", &amp;input);                   //step2
          //check input
          for (i = 0; i &lt; 7; i++) {
              if (strncmp(input, condition) == 0){//do something}
              else{
                    printf("error\n");
                    //need to do steps 1 and 2 again
          }
  </code></pre>
  
  <p>Thank you for your time, any help would be greatly appreciated!</p>