So my array is :
int **board = (int **)malloc(size * sizeof(int *)); //declaring board
for (int i = 0; i < size; i++)
board[i] = (int *)malloc(size * sizeof(int));
and my show score function is this
void showScore(int **arr)
{
int score = 0;
for(int i = 0; i <size; i++)
{
for (int j = 0; j < size; j++)
{
score += arr[i][j];
}
}
printf("score %d\n\n" , score - 2);
}
the problem I get is that the function does not work when I call it like
showScore(&board);
any suggestions how to fix my function/call it? All I need is it to calculate the sum of a 2 d dynamic array