title: C++ ifstream Error Checking
body: <p>I am new to C++ and want to add error checking to my code plus I want to make sure I'm using good coding practices.  I read a line from an ASCII file into a string using:</p>
  
  <pre><code>ifstream paramFile;
  string tmp;
  
  //open input file
  
  tmp.clear();
  
  paramFile &gt;&gt; tmp;
  
  //parse tmp
  </code></pre>
  
  <ol>
  <li><p>How can I error check to make sure the input file read was successful?</p></li>
  <li><p>I'm seeing much more complicated ways of reading from an ASCII file out there.  Is the way I'm doing it "safe/robust"?</p></li>
  </ol>