Last active
December 12, 2015 03:19
-
-
Save lseongjoo/4706074 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ERROR! | |
void printArray(int arr[][]) | |
{ | |
for(int i=0; i<2; i++) | |
for(int j=0; j<3; j++) | |
cout << a[i][j] << " "; | |
cout << endl; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using std::cout; | |
using std::endl; | |
void printArray(int[][3]); | |
int main() | |
{ | |
// 2 x 3 | |
int arr[2][3] = {{1, 2, 3}, {4, 5, 6}}; | |
printArray(arr); | |
} | |
void printArray(int arr[][3]) | |
{ | |
for(int i=0; i<2; i++) | |
for(int j=0; j<3; j++) | |
cout << a[i][j] << " "; | |
cout << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment