title: C++ ignore alphabetical characters when reading input from a file
body: <p>I have a program that takes an input stream from a text file, which contains positive integers, delimited by spaces. The file contains only numbers and one instance of <code>abc</code> which my program should ignore before continuing to read data from the file.</p>
  
  <p>this is my code and it does not work</p>
  
  <pre><code>    int line;
      in &gt;&gt; line;
      in.ignore(1, 'abc');
      in.clear();
  </code></pre>
  
  <p>could someone specify what the problem is? essentially, I want to discard the alpha input, clear cin and continue to read from file but I get an infinite loop.</p>