I am doing a program to demonstrate the application of relationships.
I need to call the functions:
int injetora(int M[N][N]){
int i,j,cont;
for(j=0; j<N; j++){
cont = 0;
for(i=0; i<N; i++){
cont += M[i][j];
if (cont > 1) return 0;
}
}return 1;
}
int total(int M[N][N]){
int i,j,cont;
for(i=0; i<N; i++){
cont = 0;
for(j=0; j<N; j++){
cont += M[i][j];
}
if (cont < 1) return 0;
}return 1;
}
I need to call these two functions within this other function:
int monomorfismo (int M[N][N]){
int boole;
boole = total(M[N][N]);
if (boole == 1){
boole = injetora(M[N][N]);
if (boole == 1){
return 1;
}else{
return 0;
}
}
return 0;
}
I just can not do it. When running the program it completely crashes with the error message:
[Warning] passing argument 1 of 'total' makes pointer from integer without a cast