title: Why does a large variable length array has a fixed value -1 even if assigned to in C?
body: <p>I'm trying to make a variable sized array in c.</p>
  
  <p>The array keeps on coming back as having a value of -1.</p>
  
  <p>What I want to do is to make an array of size <code>size</code> and then incrementally add values to it. What am I doing wrong?</p>
  
  <pre><code>int size = 4546548;
  
  UInt32 ar[size];
  //soundStructArray[audioFile].audioData = (UInt32 *)malloc(sizeof(UInt32) * totalFramesInFile);
  //ar=(UInt32 *)malloc(sizeof(UInt32) * totalFramesInFile);
  for (int b = 0; b &lt; size; b++)
  {
      UInt32 l = soundStructArray[audioFile].audioDataLeft[b];
      UInt32 r = soundStructArray[audioFile].audioDataRight[b];
      UInt32 t = l+r;
      ar[b] = t;
  }
  </code></pre>