title: Segmentation fault (core dumped) with large arrays
body: <p>I am new to <code>C++</code> programming and had written this <code>C++</code> code:</p>
  
  <pre><code>//colpitts high freq 1 GHz working with delay
  #include &lt;iostream&gt;
  #include &lt;cmath&gt;
  #include &lt;string&gt;
  #include &lt;cstring&gt;
  using namespace std;
  
  const double pi = 3.1415926;
  
  int main(){
      double c0, dx, dt,C1,C2,L,fs,Ceq, freq, tau, Rload, gload, Re, ge,gm,gc1,gc2,ic1,ic2,il,gl ;
      c0=20000000000;
      dx=0.01;
      dt=dx/(2 * c0);
      cout&lt;&lt;dt&lt;&lt;"\n";
      double V1 [1000000]={};
      double V2 [1000000]={};
      V1[0]=1e-3; 
      C1=1e-12;
      C2=5e-12;
      L=30.4e-9;
      fs=4e12;
      Ceq=(C1 * C2)/(C1+C2);
      cout&lt;&lt;Ceq&lt;&lt;"\n";
      freq=1/(2 * pi * (sqrt(L*Ceq)));
      cout&lt;&lt;freq&lt;&lt;"\n";
      tau=1/freq;
      cout&lt;&lt;tau&lt;&lt;"\n";
      Rload=50;
      Re=1e6; 
      ge=1/Re;
      cout&lt;&lt;ge&lt;&lt;"\n";
      gm=0;
      gc1=(C1)/dt;
      cout&lt;&lt;gc1&lt;&lt;"\n";
      ic1=-((C1)/dt) * V1[0];  
      cout&lt;&lt;ic1&lt;&lt;"\n";
      gc2=(C2)/dt;
      cout&lt;&lt;gc2&lt;&lt;"\n";
      ic2=-((C2)/dt) * V2[0];
      cout&lt;&lt;ic2&lt;&lt;"\n";
      gl=dt/(L);
      cout&lt;&lt;gl&lt;&lt;"\n";
      il=gl * (V2[0]-V1[0]);
      cout&lt;&lt;il&lt;&lt;"\n";
      gload=1/Rload;
      cout&lt;&lt;gload&lt;&lt;"\n";
      return (0);
  }
  </code></pre>
  
  <p>when i run it on a Linux machine, it throws an error of segmentation fault (core dumped), but when I change the array to 100000, no error is thrown and the program executes as expected. I know the problem is with physical memory allocated to me, but would there be a way around it? Can someone kindly guide me as to what modifications i need to bring in?</p>