error: cannot convert `int (*)[4]' to `int**' for argument `1' to `void show(int**, int)'Code:#include <iostream> using namespace std; void show(int **array, int size) { for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { cout <<array[i][j]; } cout << endl; } } int main() { int array[4][4] = { { 1, 1, 1, 1 }, { 1, 0, 0, 1 }, { 1, 0, 0, 1 }, { 1, 1, 1, 1 } }; show(array, 4); return 0; }
I need to pass 2d n by n arrays to a function. However, the sizes will be different but the function will do the same thing. How would I go about doing this?
Thanks for any help and suggestions