I would like to know how I can print the information collected in Creator_Matrix using the Print function. This is the code I have made so far:
#include <stdio.h>
#include <stdlib.h>
float **cria_matriz (int lin, int col){
int **mat;
int i = 0;
int j = 0;
mat = (int **) malloc (lin * sizeof (int));
for (i = 0; i < lin; i++){
mat[i] = (int *) malloc (col * sizeof (int));
}
for (i = 0; i < lin; i++){
for (j = 0; j < col; j++){
mat[j][i] = mat [i][j];
}
}
return mat;
}
void imprime (int lin, int col, float **mat){
printf("Valor na lin %d, coluda %d: ", lin, col, **mat);
}
int main (void){
int lin = 0;
int col = 0;
printf("Digite o numero de linhas da matriz:");
scanf("%d", &lin);
printf("Digite o numero de colunas da matriz:");
scanf("%d", &col);
float **matriz = cria_matriz((int) lin, (int) col);
imprime (lin, col, matriz);
return(0);
}