title: atoi function in C not working properly (when exceeding a certain value)
body: <p>Might someone explain why the <strong>atoi</strong> function doesn't work for nmubers with more than 9 digits?</p>
  <p>For example:</p>
  <p>When I enter: <code>123456789</code>,
  The program program returns: <code>123456789</code>,</p>
  <p>However,when I enter: <code>12345678901</code>
  the program returns: <code>-519403114...</code></p>
  <pre><code>int main ()
  {
      int i;
      char szinput [256];
      printf (&quot;Enter a Card Number:&quot;);
      fgets(szinput,256,stdin);
      i=atoi(szinput);
      printf(&quot;%d\n&quot;,i);
      getch();
      return 0;
  }
  </code></pre>