
-----------------------------------
copthesaint
Mon Apr 04, 2011 10:54 am

Dynamic two dimensional Arrays
-----------------------------------
So I know what increasing the bound of a dynamic array, you want to create a temperary array with the larger bound and copy the previous array to it. eg.

         int boundSize = 1;
         int

However I am just wondering how I would go about doing this with a [][] dimensional array.

-----------------------------------
Tony
Mon Apr 04, 2011 11:54 am

RE:Dynamic two dimensional Arrays
-----------------------------------
Mostly in the same way. If you have int[][] arr; wouldn't arr[x] return an int[] type?

Also, the typical strategy for resizing arrays is to double their length (instead of doing +1), but that choice depends on the behaviour of your program.

-----------------------------------
copthesaint
Mon Apr 04, 2011 4:03 pm

RE:Dynamic two dimensional Arrays
-----------------------------------
Yep, I realized like 10 min after, when I ate something, That arr[x] would return an array... I kinda just face-palmed myself.. anyways thanks :P
