Suppose I want to put a bitmap in a 2D array in memory. I determine the values for width and height in runtime (int w, h; ) and create the array..
int (*bitmap)[h]; bitmap= new int[w][h];
then I can, for instance, get R, G or B values and put them in the array.
This works fine With GCC, but Borland 5.5 gives an error: it refuses the h. If I put a number there, like
int (*bitmap)[123]; bitmap= new int[w][123];
BCC compiles without objections. But since the dimensions of the bitmap are determined in runtime that is not an option.
What's going on here? Is my code ok or isn't it?
Johan
NO USER QUESTIONS HERE...
Sorry. That wasn't clear to me. I've moved my question to the Users forum.
This is confusing... questions like this appear in all 3 forums.
Log in to post a comment.
Suppose I want to put a bitmap in a 2D array in memory. I determine the values for width and height in runtime (int w, h; ) and create the array..
int (*bitmap)[h];
bitmap= new int[w][h];
then I can, for instance, get R, G or B values and put them in the array.
This works fine With GCC, but Borland 5.5 gives an error: it refuses the h. If I put a number there, like
int (*bitmap)[123];
bitmap= new int[w][123];
BCC compiles without objections. But since the dimensions of the bitmap are determined in runtime that is not an option.
What's going on here? Is my code ok or isn't it?
Johan
NO USER QUESTIONS HERE...
Sorry. That wasn't clear to me. I've moved my question to the Users forum.
This is confusing... questions like this appear in all 3 forums.
Johan