Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you declare dynamic multidimensional array's?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I need a dynamic multidimensional array, but I get compile time errors trying to declare it.
These don't work for sure.
Square *test = new Square[number_of_rows][number_of_collumns];
Square test[][] = new Square[number_of_rows][number_of_collumns];
Square (*test)[][] = new Square[number_of_rows][number_of_collumns];

if I declare it single diminsional, and try to use it double dimensional, that doesn't work either. I know I could convert manually, but I am doing a lot of stuff and I want the code to be as readable as possible. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top