#include #include float ** initialize(int, int, float); float ** initialize(int n, int m, float v) { int i, j; if (n < 0 || m < 0) return NULL; float **matriz; matriz = (float **) malloc(n*sizeof(float*)); printf("%zu bytes\n", n*sizeof(float*)); for (i = 0 ; i < n ; i++) { matriz[i] = (float *) malloc(m*sizeof(float)); } for (i = 0; i < n; i++) { for (j =0; j < m; j++) { matriz[i][j] = v; } } return matriz; } int main() { int n, m, i, j; float v; scanf("%d %d %f", &n, &m, &v); float **variable; variable = initialize(n, m, v); if (variable == NULL) { printf("Error: Not enough memory!!!\n"); } for (i = 0; i < n; i++) { for (j =0; j < m; j++) { printf("%f ", variable[i][j]); } printf("\n"); } for (i=0; i < n; i++) { free(variable[i]); } free(variable); return 0; }