title: C: How do I convert a string to int which will be in long int format
body: <p>I want to convert a string <code>&quot;12341234123412341234&quot;</code> to int, but when I use atoi it returns <code>-1</code></p>
  <pre><code>char n[100] = &quot;12341234123412341234&quot;;
  printf(&quot;%d&quot;,atoi(n));
  </code></pre>
  <p>returns <code>-1</code></p>
  <p>if i use <code>%ld</code> or <code>%lld</code> it returns a junk value</p>
  <pre><code>char n[100] = &quot;12341234123412341234&quot;;
  printf(&quot;%lld&quot;,atoi(n)); //even if i use %ld it returns the same value
  </code></pre>
  <p>returns <code>4294967295</code></p>