title: stringstream extraction not working
body: <p>I seem to be having a problem with extracting data from a stringstream. The start of my extraction seems to be missing the first two characters.</p>
  
  <p>I have something similar to the following code:</p>
  
  <pre><code>    std::stringstream ss(
      std::stringstream::in |
      std::stringstream::out
      );
  
      bool bValid;
      double dValue;
      double dTime;
  
      for( (int i = 0; i &lt; 5; i++ )
      {
          bValid = getValid();
          dValue = getValue();
          dTime = getTime();
  
          // add data to stream
          ss &lt;&lt; bValid;
          ss &lt;&lt; dValue;
          ss &lt;&lt; dTime;
      }
  
      int strsize = ss.str().size();
      char* data = new char[strsize];
      std::strcpy(data, ss.str().c_str());
  
      // then do stuff with data
      // ...... store data in an Xml Node as CDATA
  
      // read data back
      std::stringstream ssnew( std::stringstream in | std::stringstream out );
      ss.clear();
      ss &lt;&lt; getCharData(); // returns a char* and puts it in stream.
  
      for( int i = 0; i &lt; 5; i++ )
      {
          ssnew &gt;&gt; bValid;  // do something with bValid
          ssnew &gt;&gt; dValue;  // do something with dValue
          ssnew &gt;&gt; dTime;   // do something with dTime
      }
  </code></pre>
  
  <p>I am having a problem that when I use the extraction operator when reading data from "ssnew" it seems to skip the first two characters. In the debugger, for example, it is showing that the stringstream has "001.111.62.2003... etc". However, after the first "ssnew >> bValid" bValid becomes "true" and dValue becomes "0.111" and dTime becomes "0.62" indicating that the first two zeros in the stream are being ignored. Why isn't it starting at the beginning of the stream?</p>
  
  <p>Cheers,
  Seth</p>