title: atoi vs atol vs strtol vs strtoul vs sscanf
body: <p>I'm trying to figure out from a command line being parsed, which function would be best to convert either a decimal, hexadecimal, or octal number to an <code>int</code> the best — without knowing the input beforehand.</p>
  
  <p>The goal then is to use a single function that recognizes the different types of inputs and assign that to its integer (<code>int</code>) value which can then be used so:</p>
  
  <pre><code>./a.out 23 0xC4 070
  </code></pre>
  
  <p>could print </p>
  
  <pre><code>23
  196 /*hexadecimal*/
  56  /*octal*/
  </code></pre>
  
  <p>The only issue that I can see is the parsing to find the difference between a decimal integer and an octal.</p>
  
  <p>Side question, is this stable for converting the string to an integer for use?</p>