title: Check if input is a number and if not input again
body: <p>I trying something really simple but in same time a little bit hard for me. I want to let user to insert number via console and if is not number to tell that is not and give chance to insert again while is number. 
  Here is what I've made so far</p>
  
  <pre><code>int a;
  
   cout&lt;&lt;"enter a: ";
   cin&gt;&gt;a;
   while (!isdigit(a)); {
      cout &lt;&lt; "\n ERROR, enter a number" ;
      cin.clear();
      cin &gt;&gt; a;
   }
  
  system("Pause");
  return 0; 
  </code></pre>
  
  <p>Now I get error that is not number but the program is terminate. I can't insert again and must start it again.</p>