I'm trying to send a 2D array (int arr[5][5]
, initialized with numbers) to a function, the prototype of the function is:
int function(int **arr, int size, int *pi, int *pj);
so I type in main()
:
size=function(arr, 5, &i, &j);
(i
and j
are not initialized)
I'm getting an error "Access violation reading location" which tells me it can't read from the array, because it isn't pointing anywhere.
The prototype cannot be changed, how can I fix it?