23.03.2013 Views

Arrays, parameter passing, pointers and dynamic allocation. - ELIS

Arrays, parameter passing, pointers and dynamic allocation. - ELIS

Arrays, parameter passing, pointers and dynamic allocation. - ELIS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Passing Multi-D <strong>Arrays</strong><br />

void printArray( const int[][3],<br />

int main() {<br />

}<br />

int numRows );<br />

int array1[2][3] = {1, 2, 3, 4};<br />

printArray(array1, 2);<br />

return 0;<br />

void printArray( const int[][3], //why?<br />

}<br />

47<br />

int numRows) {<br />

for (int i = 0; i < numRows; i++) {<br />

}<br />

for (int j = 0; j < 3; j++) {<br />

cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!