As far as I know, this isn't caused by an infinite recursion.
The program functioned correctly with smaller arrays (it is an audio editor). Now I have increased functionality to allow for larger arrays (up to 5 minutes of audio, 26460000 pieces of 16bit data ~50mb).
Since increasing the array's size I am receiving stack overflow errors on one particular function, where it should reverse the playback of an input file by writing the array into a new array backwards, then overwriting the original array. I'm guessing as each array could be up to 50MB this may be where the problem lies:
//initialise temporary new array to place samples in
short signed int reverse_data[max_number_samples];
for (i=0; i<track_samples; i++)
{ //puts data from sound_data into reverse_data backwards.
reverse_data[(max_number_samples-1)-i]=sound_data[i];
}
for (i=0; i<track_samples; i++)
{ //now overwrites sound_data with the data in reverse_data
sound_data[i]=reverse_data[i];
}
I'm fairly new to C++, and programming in general, and am unsure of what the errors I get during debug are really telling me.
Any help would be appreciated, I'm sure there's a simple enough solution (I've read stuff involving 'heaps' but I'm not confident of what a'heap' really is).