title: nth character of string to int
body: <p>How can I convert nth character of string to number? I have a long number expressed as string and I'd like to make an array of it, where each character would be seperate number. I've tried with followed piece of code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;sstream&gt;
  using namespace std;
  
  int main()
  {
      string str ="73167176531330624919225119674426574742355349194934969835203127745063262395783180169848018";
      int ints[1000] = {0};
  
      for (int i = 0; i &lt; str.size(); i++)
      {
          istringstream ss(str[i]);
          ss &gt;&gt; ints[i];
      }
  
      cout &lt;&lt; ints[9] &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>
  
  <p>But it doesn't work.</p>