title: Segmentation fault with array
body: <p>I am writing a fairly simple code to enter integers stored in a file into an array of moderate size, but on compiling and running the code, it gives Segmentation fault error, can anyone please correct me where I am making a mistake, the code is</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  #include &lt;cstdlib&gt;
  
  using namespace std;
  
  int main()
  {
      int arr[100000];
      ifstream f;
      f.open("IntegerArray.txt");
      string line;
  
      if (f.is_open())
      {
          int i=0;
          while (f.good())
          {
              getline(f,line);
              arr[i++] = atoi(line.c_str());
          }
          f.close();
      }
      else
          cout&lt;&lt;"file not open";
      return 0;
  }
  </code></pre>