title: C++, Convert string to int
body: <p>I`ve tried many ways to convent a string to a int. This includes atoi() and stringstream <br>
  But i still cannot convert it. I have a only numeric string and i want to convert it to a int.</p>
  
  <p>The reason for that is that im receiving data form user using <strong>getch()</strong> and storing it into a string buffer, but in a certain point i want to convert this buffer to a int for use.
  So my string would be like that:</p>
  
  <pre><code>string hello = "673";
  </code></pre>
  
  <p>And i want to transform this value into an interger.
  <strong>EDIT</strong>
  This is not a duplicated questions because i tried
  all this methods many times and still now work.All of this just crash my program or error an invalid conversion.</p>