title: Stuck in loop while trying to get input from cin
body: <p>Okay I'm very new to C++, I'm experianced with C# and I don't really know what is wrong in my code. I'm just trying to figure out how to check whether the user's input is a integer or string.</p>
  
  <p>But when I type 'a' or some other string, the while loop never ends.</p>
  
  <pre><code>    #include &lt;iostream&gt;
  
  using namespace std;
  
  int main ()
  {
      int number;
      goto skip;
      do
      {
          cout &lt;&lt; "Wrong input. Try again.";
  skip:
          cout &lt;&lt; "Number: ";
          cin &gt;&gt; number;
      }
      while (!cin);
      cout &lt;&lt; "Correct input.";
      system("PAUSE");
  }
  </code></pre>