int width = 2560; int height = 1440; int frameBuffer[width*height]; for (int i = 0; i < width*height; ++i) frameBuffer[i]=i;
This code locks
the number of elements the array is going to hold, must be a constant value, since arrays are blocks of non-dynamic memory whose size must be determined before execution. In order to create arrays with a variable length dynamic memory is needed
use int frameBuffer[2560*1440];
int frameBuffer[2560*1440];