Arrays, parameter passing, pointers and dynamic allocation. - ELIS
Arrays, parameter passing, pointers and dynamic allocation. - ELIS
Arrays, parameter passing, pointers and dynamic allocation. - ELIS
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
array2d<br />
Pointers to Pointers<br />
int **array2d = new int*[6];<br />
for (int i = 0; i < 6; i++) {<br />
array2d[i] = new int[7];<br />
[0][0] [0][1] [0][2] [0][3] [0][4] [0][5] [0][6]<br />
[1][0] [1][1] [1][2] [1][3] [1][4] [1][5] [1][6]<br />
} //Dynamically allocated 2d arrays NOT contiguous in<br />
memory (each new is contiguous)<br />
73<br />
.<br />
.<br />
.