title: how to loop back if a user enters a letter instead of a number c++
body: <p>My program identifies that a user has entered a letter instead of a number, but it doesn't ask for user input after that. I need to be able to prompt the user to enter another value that is a number and create a loop or something that will check the value every time to make sure it isn't a letter/s. </p>
  
  <p>This is the part of my code that does the check for invalid character:</p>
  
  <pre><code>while (!cin.good())
  {
  cout &lt;&lt; "Error! I only accept numbers! Enter in a number." &lt;&lt; endl;
  cin.clear();
  cin.ignore(numeric_limits&lt;streamsize&gt;::max());
  }
  </code></pre>