title: Why am I unable to make this conversion?
body: <p>I have the following piece of code for reading an input file and converting that input into an integer. It worked for some inputs but it isn't work anymore and that has been confusing me. (C++)</p>
  
  <pre><code>ifstream inputfile;
  
  inputfile.open("inputfile.txt"); //openfile and read
  string m; //fileforstringinput
  getline(inputfile, m); //importing input information
  long int s = atol(m.c_str());   //conversion to integer
  inputfile.close(); //close file
  cout &lt;&lt; s;
  </code></pre>
  
  <p>When using this for small numbers it was fine. I tried the number from Project Euler problem 3 (600851475143)</p>
  
  <p>and that failed to convert.</p>
  
  <p>Does this exceed the size of long integers</p>