I have an array constructed in a function. I want to return the array and store the value in another array. Somehow it does not work. It does not show any kind of errors but it just doesn't work.
int** matrixMultiplier(int A[2][2], int B[2][2], int dimension){
int p, q, r, s, t, u, v, i, j;
int C[2][2];
p = (A[0][0] + A[1][1]) * (B[0][0] + B[1][1]);
q = (A[1][0] + A[1][1]) * B[0][0];
r = A[0][0]*(B[0][1] - B[1][1]);
s = A[1][1]*(B[1][0] - B[0][0]);
t = (A[0][0] + A[0][1]) * B[1][1];
u = (A[1][0] - A[0][0]) * (B[0][0] + B[0][1]);
v = (A[0][1] - A[1][1]) * (B[1][0]+B[1][1]);
C[0][0] = p+s-t+v;
C[0][1] = r+t;
C[1][0] = q+s;
C[1][1] = p-q+r+u;
return C;
}
void main(){
int A[2][2] = {{2, 3},
{4, 5}};
int B[2][2] = {{4, 3},
{7, 8}};
int p, q, r, s, t, u, v, i, j;
int **C = matrixMultiplier(A, B, 2);
for(i = 0; i<2; i++){
for(j=0; j<2; j++){
printf("%d\t", C[i][j]);
}
printf("\n");
}
}```