If the following is possible:
Why the following is not?Code:MyFunction(int *array, int size) { for(int i=0 ; i<size ; i++) { printf(“%d”, array[i]); } } main() { int array[] = {0, 1, 2, 3, 4, 5}; MyFunction(array, 5); }
Code:MyFunction(int **array, int row, int col) { for(int i=0 ; i<row ; i++) { for(int j=0 ; j<col ; j++) { printf(“%d”, array[i][j]); } } } main() { int array[][] = {0, 1, 2, 3, 4, 5, 6, 7, 8}; MyFunction(array, 3, 3); }