title: How do I use atoi function with strings in C++
body: <p>This is a basic question. I use C++ but not C++11. Now, I want to convert a string to an integer. I have declared like this:</p>
  
  <pre><code>string s;
  
  int i = atoi(s);
  </code></pre>
  
  <p>However, this shows an error that such a conversion is not possible. I checked out the internet and I found that C++11 has stoi() but I want to use atoi itself. How can I do it? Thanks!</p>