title: C: Resolving segmentation fault due to possibly insufficient memory
body: <p>I am coming up against a segmentation fault in my code that I can only explain through insufficient available memory. What is happening is that I am trying to create a <code>NxN</code> matrix where <code>N</code> is a large number. For <code>N=8</code>, the programme runs fine, but for <code>N&gt;=16³=5000</code>, I get a segmentation fault automatically. This is ew Is there any simple way of solving this problem? I actually want to simulate sizes of the range <code>N=64³</code> if possible, so this is a very essential question for me.</p>
  
  <p>My code structure is as follows.</p>
  
  <pre><code>const int N=16**3;
  int main(int argc, const char * argv[]) {
  double rnorm[N][N];
  ...
  }
  
  void Diluisci(..., double rnorm[N][N]{
  ...
  AdjMatOnestep(rnorm);
  }
  
  void AdjMatOnestep(double rnorm[][N]){
  ...}
  </code></pre>
  
  <p>So <code>main()</code> calls <code>Diluisci()</code> which calls <code>AdjMatOnestep()</code>, and as soon as I call this last function, I get a segmentation fault. I don't even enter into the first line of it. DDD says "error reading variable: Cannot access memory at address ...".</p>
  
  <p>Any ideas?</p>