I am writing a program related to Graph Theory, I wrote code for matrix multiplication by using functions, that worked well. when I am using that function into this program I am getting following errors.
I don't understand why this is happening?
Here I am giving you the part of code from my whole program.
float product(int,int,int,int,float a[20][20],float b[20][20],float c[20][20]);
float yn[ar][ar],temp[ar][ac];
product(ar,ac,ac,ac,incidence,yb,temp);
float product(int ar,int ac,int br,int bc,float a[20][20],float b[20][20],float c[20][20])
{ int i,j,k;
if(ac==br)
{
for(i=0;i<ar;i++)
{
for(j=0;j<bc;j++)
{
c[i][j]=0;
for(k=0;k<ac;k++)
{
c[i][j]=c[i][j]+(a[i][k]*b[k][j]);
}
}
printf("\n");
}
}
else
{
printf("Please Enter proper matrices");
return -1;
}
return 0;
}
When I run this, I am getting these errors.
prog.c: In function ‘main’:
prog.c:40: warning: passing argument 5 of ‘product’ from incompatible pointer type
prog.c:4: note: expected ‘float (*)[20]’ but argument is of type ‘int (*)[(unsigned int)(ac)]’
prog.c:40: warning: passing argument 6 of ‘product’ from incompatible pointer type
prog.c:4: note: expected ‘float (*)[20]’ but argument is of type ‘int (*)[(unsigned int)(ac)]’