Please, someone educate me here!!!
I originally wrote some C code to allocate a matrix:
UBYTE (*BrickBuffer)[MAX_GRIDX][MAX_GRIDY];
BrickBuffer = AllocMem(sizeof(*BrickBuffer), 0L);
This works fine. I then tried to make the above work using the new operator in C++:
UBYTE (*BrickBuffer)[MAX_GRIDX][MAX_GRIDY];
BrickBuffer = new(UBYTE[MAX_GRIDX][MAX_GRIDY]);
The above gets me this error is SAS6.58:
Src/LevelData.cpp 354 Error 1544: ( unsigned char (*)[58][41]) = ( unsigned char (*)[41]): Invalid type for binary operator.
Okay, why is it doing this to me?!!? I obviously don't understand how the new() operator works here. So how does one dynamically allocate a matrix in C++ using new()?!?!? Any suggestions???
- Mike