using new[] to cre8 multi demensional arays
How do i use the new[] operator to cre8 a multi dimensional array??? ie
int myArray[2][2];
int *myDynamicArray;
myDynamicArray = new myDynamicArray[2][2]; //doesnt work
~prevail by daring to fail~
Hi
You have to use function malloc
However in this case, won''t help you much
because array[x][x] have special struct
Whatsoever in c/c++ saying somewhere in code (main or WinMain)
int array[2][2]
is already a dynamic reservation,...
I really hope i helped you
You have to use function malloc
However in this case, won''t help you much
because array[x][x] have special struct
Whatsoever in c/c++ saying somewhere in code (main or WinMain)
int array[2][2]
is already a dynamic reservation,...
I really hope i helped you

Try this:
hope that helps.
|
hope that helps.
August 08, 2001 09:03 AM
ITH3 is right,
but may also use this...
int (*myDynamicArray)[2];
myDynamicArray = new float[2][2];
ccc...
but may also use this...
int (*myDynamicArray)[2];
myDynamicArray = new float[2][2];
ccc...
August 08, 2001 09:04 AM
ITH3 is right,
but may also use this...
int (*myDynamicArray)[2];
myDynamicArray = new int[2][2];
ccc...
but may also use this...
int (*myDynamicArray)[2];
myDynamicArray = new int[2][2];
ccc...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement