Lord Olleus
Sep 25, 2006, 03:44 PM
... Does anyone here know how to create multidimentional, dynamic arrays in C++? (If you have no idea what I am talking about, don't worry)
I tried this:
float* = MyArray;
MyArray = new float[x][y];
But the compiler told me that I couldn't convert a float (*)[y] into a float*.
I then tried this:
float MyArray[x][y];
But unsuprisingly that didn't work, as the compiler said that the array size had to be fixed at compile time.
I then tried this:
void* = MyArray:
MyArray = new float[x][y]
And that worked. But my compiler then complained when ever I tried to use the array.
I tried to google this and looked through my books, but I couldn't find anything. Anyone here know how to do this?
I tried this:
float* = MyArray;
MyArray = new float[x][y];
But the compiler told me that I couldn't convert a float (*)[y] into a float*.
I then tried this:
float MyArray[x][y];
But unsuprisingly that didn't work, as the compiler said that the array size had to be fixed at compile time.
I then tried this:
void* = MyArray:
MyArray = new float[x][y]
And that worked. But my compiler then complained when ever I tried to use the array.
I tried to google this and looked through my books, but I couldn't find anything. Anyone here know how to do this?