1. ## multiplying two matrices

I'm trying to use a function to multiply two matrices. But I am not supposed to use brackets []. Also the function only accept single pointers as arguments. How can I rewrite the algorithm to use pointer arithmetic?

Code:
```void mult_matrices(int *A, int *B, int *C, int m, int n, int p){
int i, j, k;

for(i=0; i < m; i++){
for(j=0; j < p; j++) {
C[i][j] = 0;
for(k=0; k < n; k++){
C[i][j] += A[i][k] * B[k][j];
}
}
}```

2. Firstly, it would help if you started with code that worked in a valid way on the arrays. The code you have supplied will not even compile (A, B, and C are pointers to int, so cannot be used with two subscripts viz A[i][k]).

Once you get that sorted out, I'm not going to solve your problem for you, but will give you two hints. I have deliberately crafted those hints so you need to think, but they do point you in the right general direction.

If x is a one-dimensional array, or a pointer to the first element in a one-dimensional array, then x[i] is equivalent to *(x + i).

Things break down a little after that (a 2D array is not quite equivalent to a pointer-to-pointer): however, a 2D array is a 1D array of 1D arrays.