I'm trying to create a null matrix with the method zeros (); and then show it on the screen. Nothing is shown.
double * zeros(int m,int n){
double matrix[3][3] ={0};
return matrix;
}
void printMatrice(int row,int column, double matrix [3][3]) {
for (row=0; row<3; row++)
{
for(column=0; column<4; column++)
{printf("%f ", matrix[row][column]);}
printf("\n");
}
}
MAIN:
int main () {
printMatrice(3,3,zeros(3,3));
return 0;
}
Show this on screen:
Process returned -1073741819 (0xC0000005)
These are the warnings
Of method printMatrice():
--warning: passing argument 3 of 'printMatrice' from incompatible pointer type [-Wincompatible-pointer-types]|
Of method zeros():
-- warning: returning 'double (*)[3]' from a function with incompatible return type 'double *' [-Wincompatible-pointer-types]
--warning: function returns address of local variable [-Wreturn-local-addr]|