title: C++ - How do you loop back after user input?
body: <p>In my previous question, I got this answer to work so that if the user inputs more than 5 characters in the nation name, it will output an error.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  
  int main()
  {
      using namespace std;
  
      const int maxchar = 5;
      string nationname;
  
      cout &lt;&lt; "What is the name of your nation?" &lt;&lt; endl;
  
      cin &gt;&gt; nationname;
  
      if (nationname.size() &gt; maxchar)
      {
         cout &lt;&lt; "The input is too long." &lt;&lt; endl;
         return 1;
      }
  }
  </code></pre>
  
  <p>I want it so that it will loop back to the "cout &lt;&lt; what is the name..." after it outputs the error.</p>
  
  <p>Thanks!</p>
  
  <p>Someone answered on my previous question how in the comments but I didn't get it to work/I don't know how or where to put it in my code.</p>