title: Reading through file using ifstream
body: <p>I am trying to read from file:
  The file is multiline and basically i need to go over each "word". Word being anything non space. </p>
  
  <p>Sample input file would be: <br></p>
  
  <blockquote>
    <p>Sample file:</p>
    
    <p>test 2d<br>
        word 3.5<br>
        input<br>
        {<br><br>
          test 13.5 12.3<br>
          another {<br>
           testing 145.4 <br>
           } <br>
         }</p>
  </blockquote>
  
  <p>So I tried something like this:  </p>
  
  <pre><code>ifstream inFile(fajl.c_str(), ifstream::in);
  
  if(!inFile)
  {
      cout &lt;&lt; "Cannot open " &lt;&lt; fajl &lt;&lt; endl;
      exit(0);
  }
  
  string curr_str;
  char curr_ch;
  int curr_int;
  float curr_float;
  
  cout &lt;&lt; "HERE\n";
  inFile &gt;&gt; curr_str;
  
  cout &lt;&lt; "Read " &lt;&lt; curr_str &lt;&lt; endl;
  </code></pre>
  
  <p>The problem is when it reads new line it just hangs. I read everything before test 13.5
  but once it reaches that line it doesnt do anything.
  Anyone can tell me what I am doing wrong?
  Any better suggestion on how to do this???</p>
  
  <p>I essentially need to go through file and go one "word" (non white char) at the time.
  I </p>
  
  <p>Thanks</p>