title: Stringstream when iterating through string doesnt work
body: <p>So i want to use string stream to convert strings to integers.</p>
  
  <p>assume everything is done with:</p>
  
  <pre><code> using namespace std;
  </code></pre>
  
  <p>a basic case that seems to work is when I do this:</p>
  
  <pre><code> string str = "12345";
   istringstream ss(str);
   int i;
   ss &gt;&gt; i;
  </code></pre>
  
  <p>that works fine.</p>
  
  <p>However lets say I have a string defined as:</p>
  
  <pre><code>string test = "1234567891";
  </code></pre>
  
  <p>and I do:</p>
  
  <pre><code>int iterate = 0;
  while (iterate):
      istringstream ss(test[iterate]);
      int i;
      ss &gt;&gt; i;
      i++;
  </code></pre>
  
  <p>this doesnt work as i want. essentially I was to idividually work on each element of the string as if it is a number, so i want to convert it to an int first, but i cant seem too. Could someone please help me?</p>
  
  <p>the error i get is:</p>
  
  <pre><code>   In file included from /usr/include/c++/4.8/iostream:40:0,
               from validate.cc:1:
  /usr/include/c++/4.8/istream:872:5: note: template&lt;class _CharT, class _Traits, class _Tp&gt; std::basic_istream&lt;_CharT, _Traits&gt;&amp; std::operator&gt;&gt;(std::basic_istream&lt;_CharT, _Traits&gt;&amp;&amp;, _Tp&amp;)
   operator&gt;&gt;(basic_istream&lt;_CharT, _Traits&gt;&amp;&amp; __is, _Tp&amp; __x)
   ^
  /usr/include/c++/4.8/istream:872:5: note:   template argument     deduction/substitution failed:
  validate.cc:39:12: note:   ‘std::ostream {aka std::basic_ostream&lt;char&gt;}’ is not derived from ‘std::basic_istream&lt;_CharT, _Traits&gt;’
  cout &gt;&gt; i &gt;&gt; endl;
  </code></pre>