title: Why shouldn't I use atoi()?
body: <p>Someone told me that I shouldn't use <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/atoi.html"><code>atoi()</code></a>, and that I should always use <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/strtol.html"><code>strtol()</code></a> instead. What's wrong with <code>atoi()</code> that I shouldn't use it? Is <code>strtol()</code> really the right thing to use instead? (And what about the fact that <code>strtol()</code> returns a <code>long</code>, not an <code>int</code> like <code>atoi()</code> does?)</p>