title: How do I restart a C++ command prompt application?
body: <p>I am creating a game that will run out of a C++ command prompt.</p>
  
  <p>The game is called PIG. You are playing against a computer, and your goal is to reach 100 GAME SCORE by rolling dice. If you roll a 1, your turn ends and you add nothing to your score. If you roll any other number, it gets added to your "TURN SCORE". After a roll, you have the option to roll again or to "hold". Holding adds your "TURN SCORE" to your "GAME SCORE" and passes the turn to the next player.</p>
  
  <p>Everything works the way I want it to, but now I am trying to create a playagain() function that will ask the user at the end of a game if they wish to play again. If they do, the app restarts and zero's all variables. If they do not, the program exits.</p>
  
  <p>Here is what I have in regards to my question:</p>
  
  <pre><code>if(comp_score == 100){
      char ans;
      cout &lt;&lt; "Your opponent has reached a score of 100 and has won! Would you like to play again? [y/n] ";
      cin &gt;&gt; ans;
      if(ans == 'y'){
          /*restarts application and zero's all variables*/
          playagain();
      } else if(ans == 'n'){ exit(); }}
      if(play_score == 100){
      char ans;
      cout &lt;&lt; "You have reached a score of 100 and have won! Would you like to play again? [y/n] ";
      cin &gt;&gt; ans;
      if(ans == 'y'){
          /*restarts application and zero's all variables*/
          playagain();
      } else if(ans == 'n'){ exit(); }
  }
  </code></pre>
  
  <p>TIA!</p>