Below did not work. Is there anyother way?
#include<stdio.h>
#include<math.h>
const int No=2;
int* mat_sum(int[][No], int[][No],int);
void main(){
int A[No][No]={{0,2},{0,1}};
int B[No][No]={{0,1},{1,0}};
int *Result=0;
Result=mat_sum(A,B,No);
}
int* mat_sum (int A[][No], int B[][No],int length){
int *C=new int[No][No];
for (int i=0;i<length;i++){
for (int j=0;j<length;j++){
C[j]=0;
C[j]=A[j]+B[j];
// printf("%2d",C[j]);
}
}
return C;
}