Q:

Multiplying Matrices by Using Pointers in C

I am trying to create a method which is like this: 
void Multiply(double *A, double *B, double *C, int N);
It is a function that computes C = A * B.
A, B and C are NxN(square) matrices and I have to do it by pointers.
The code I have written is like the following:
int Multiply(double *A, double *B, double *C, int N){
    int i,j,k;
    double sum;
    for (i = 0; i < N; i++) {
      for (j = 0; j < N; j++) {
         sum = 0;
         for (k = 0; k < N; k++) {

            sum = sum + (*(A+i*N+k)) * (*(B+k*N+i));
         }
         *(C+i*N+j) = sum;
      }
   }
}

It doesn't cause any errors and also it is not working.
I can't see the problem. Please can anybody help?

A:

i,j element of C is the row i of A multiply by the j column of B. The kernel of your loops should be: 
sum = sum + (*(A+i*N+k)) * (*(B+k*N+j));

