This line is just begging for an error in pointer arithmetic. Just access you're 2-D array as a 2-D array:Code:printf("so the values for the array ar %d: ", *(*(mat+j)+k));
Also note, you don't actually need k. It's a better idea to reuse i and j, keeping their usage consistent (i for rows, j for cols).Code:printf("so the values for the array ar %d: ", mat[j][k]);