title: c++: stringstream to vector
body: <p>I'm trying to store the data that is in a stringstream into a vector. I can succesfully do so but it ignores the spaces in the string. How do I make it so the spaces are also pushed into the vector?</p>
  
  <p>Thanks!</p>
  
  <p>Code stub:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;sstream&gt;
  #include &lt;vector&gt;
  
  using namespace std;
  
  int main()
  {
      stringstream s;
      string line  = "HELLO HELLO\0";
  
      stringstream stream(line);
  
      unsigned char temp;
      vector&lt;unsigned char&gt; vec;
      while(stream &gt;&gt; temp) 
          vec.push_back(temp);
  
  
      for (int i = 0; i &lt; vec.size(); i++)
           cout &lt;&lt; vec[i];
      cout &lt;&lt; endl;
      return 0;
  }
  </code></pre>