title: Convert string to int in C++
body: <p>I have a string <code>xxxxxxxxxxxxxxxxxxx</code></p>
  
  <p>I am reading the string into a structure of smaller strings, and using substr to parse it.
  I need to convert one of those string types to integer.</p>
  
  <p><code>atoi</code> is not working for me,. any ideas? it says <code>cannot convert std::string to const char*</code></p>
  
  <p>Thanks</p>
  
  <pre><code>#include&lt;iostream&gt;
  
  #include&lt;string&gt;
  
  using namespace std;
  
  void main();
  
  {
      string s="453"
  
          int y=atoi(S);
  }
  </code></pre>