SDL_Rect *rect = new SDL_Rect[4][2];
Error says: "Error: 'this' cannot be used in a constant expression." Any help??? Happens on the second dimension of the array.
SDL_Rect *rect = new SDL_Rect[4][2];
Error says: "Error: 'this' cannot be used in a constant expression." Any help??? Happens on the second dimension of the array.
If you know the size of the array, just
SDL_Rect rect[4][2];
will do what you want.
If you know all dimensions but the first (or if you really need the matrix to be in the heap), you can do
SDL_Rect (*rect)[2] = new Rect[x][2];
Have a look at this:
The correct way to initialize a dynamic pointer to a multidimensional array?
Initialization of multidimensional arrays is clearly explained.