Your sample code is a bit confusing - are you allocating a 2D array of objects? if so, try this:
UBYTE **BrickBuffer;
int i;
BrickBuffer = new UBYTE*[MAX_GRIDX];
for (i = 0;i < MAX_GRIDX;i++)
BrickBuffer
= new UBYTE[MAX_GRIDY];
You can then use the array as usual, eg BrickBuffer
when deleting the array, do it like this:
for (i = 0;i < MAX_GRIDX;i++)
delete[ ] BrickBuffer;
delete[ ] BrickBuffer;
SAS/C implements an older version of the C++ standard, but I don't think even newer compilers support anything other than new, new[] and new().