title: Stringstream extract integer
body: <p>Why do I fail to extract an integer value into the <code>Num</code> variable?</p>
  
  <pre><code>#include &lt;sstream&gt;
  #include &lt;vector&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
      string Digits("1 2 3");
      stringstream ss(Digits);
      string Temp;
      vector&lt;string&gt;Tokens;
  
      while(ss &gt;&gt; Temp)
          Tokens.push_back(Temp);
  
      ss.str(Tokens[0]);
  
      int Num = 0;
      ss &gt;&gt; Num;
      cout &lt;&lt; Num;    //output: 0
  }
  </code></pre>