title: Skip leading whitespaces but not the newline C++ istreams
body: <p>I am trying to remove leading whitespace and store the characters after the whitespace. I don't want the newline to be considered</p>
  
  <p>This is a file that I am reading from:</p>
  
  <pre><code>Map: Out of planet
  Player:    Max
  </code></pre>
  
  <p>My expected result and what I am looking for should be </p>
  
  <pre><code>cout &lt;&lt; kill.killMap &lt;&lt; endl; 
  Out of planet    // NOTICE THERE IS NO WHITESPACE
  cout &lt;&lt; kill.player &lt;&lt; endl;   
  Max             // NOTICE THERE IS NO WHITESPACE
  </code></pre>
  
  <p>If the file looks like this...</p>
  
  <pre><code>Map: 
  Player:    Max
  </code></pre>
  
  <p>Nothing should be stored in the <code>map</code> variable and <code>player</code> variable.</p>
  
  <p>Although the ws function removes whitespace from the stream, I don't think it does the same with char arrays. Would really appreciate it if someone could tell me a way of getting ws to work or just simply an efficient way of removing the whitespace</p>
  
  <p>This is what I am getting:</p>
  
  <pre><code>cout &lt;&lt; kill.killMap &lt;&lt; endl; 
    Out of planet  //THERE IS WHITESPACE
  cout &lt;&lt; kill.player &lt;&lt; endl;   
        Max  //THERE IS WHITESPACE
  </code></pre>
  
  <p>Is there a way of doing this without using C++ strings or Vectors. I intend on using C Style strings</p>
  
  <p>THIS IS MY EDITED CODE, HOWEVER IT DOESN'T WORK IF THERE ARE VALID CHARACTERS AFTER THE DELIMITER <code>:</code>... WOULD REALLY APPRECIATE IT IF SOMEONE COULD FIX MY CODE, WOULD MEAN A LOT TO ME.</p>
  
  <pre><code>istreams.get(characters, 50, ':');
  istreams.get(c);
  istreams.getline(kill.killMap, 35);
  while ((is.get(c) != "\n") &amp;&amp; (is.get(c) != '\0') )
  {
      is &gt;&gt; ws;
  }
  is.getline(kill.killMap, DATA_FILE_SIZE);
  if(kill.killMap[0] = '\0)
  { 
     cout &lt;&lt; "Error;
     break;
  }
  istreams &gt;&gt; ws;
  
  istreams.get(characters, 50, ':');
  istreams.get(c);
  while ((is.get(c) != "\n") &amp;&amp; (is.get(c) != '\0') )
  {
      is &gt;&gt; ws;
  }
  istreams.getline(kill.player, 35);
  if(kill.player[0] = '\0)
  { 
     cout &lt;&lt; "Error;
     break;
  }
  </code></pre>