Creating a 2 dimensional array with the new operator??

I cant find anything on this subject.

this is what i tried.

in the header file i have

float* m_entries;

in the constructor i wanted to have this

m_entries = new float [2][2];

and i got some errors
You can't allocate a multidimentional array like that.

Here: http://cplusplus.com/forum/articles/17108/

See the "MD Array Flavor 2: Nested New (dynamic)" portion. But note the overall tone of the article: MD arrays are evil.
yea i usually dont like to work with them. But in fact i think it would best represent the Matrix class im trying to make for the fun of it.
But in fact i think it would best represent the Matrix class im trying to make for the fun of it.


It actually probably wouldn't.

But whatever. =P
Topic archived. No new replies allowed.