I'm trying to make a variable sized array in c.
The array keeps on coming back as having a value of -1.
What I want to do is to make an array of size size
and then incrementally add values to it. What am I doing wrong?
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 < size; b++)
{
UInt32 l = soundStructArray[audioFile].audioDataLeft[b];
UInt32 r = soundStructArray[audioFile].audioDataRight[b];
UInt32 t = l+r;
ar[b] = t;
}