title: Won´t read whitespace with ifstream
body: <p>I am relatively new to C++, so be gentle.
  I have a text-file I want to read, but when i read the file it skips the whitespace (space) between separated words.</p>
  
  <p>I tried to take away as much junk-code as possible so it would be easier to read.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;sstream&gt;
  #include &lt;fstream&gt;
  
  using namespace std;
  
  int main(.....)
  {
      ifstream in_file;
      string filename;
      string status;
      readStringToMem(in_file, status);
  
      cout &lt;&lt; "Type in the filename :    ";
      getline(cin, filename);    
      in_file.open(filename);
      readStringToMem(in_file, status);
  }
  
  void readStringToMem(ifstream&amp; in_file, string&amp; string_value)
  {
      string input_string;
      getline(in_file, input_string, '|');
      stringstream myInputStream(input_string);
      myInputStream &gt;&gt; string_value;
  }
  </code></pre>
  
  <p>My file may look like this:</p>
  
  <blockquote>
    <p>Status is ok   |  100</p>
  </blockquote>
  
  <p>But when I read it, it comes out like this:</p>
  
  <blockquote>
    <p>Status      100</p>
  </blockquote>
  
  <p>Thanks in advance! Any help will be great!</p>