Gradualmente approderò anche io a quei linguaggi, e spero nella scelta saggia.
Tornando al C, non va ancora ahah
codice://Creo le righe char *** result = calloc(rows, sizeof(char **)); //Creo le colonne for (int i = 0; i < cols; i++) { result[i] = calloc(cols, sizeof(char *)); } //Carico la matrice for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { result[i][j] = (char *)malloc(100 * sizeof(char)); if (NULL != result[i][j]) { strcpy(result[i][j], "ciao"); } } printf("\n"); } //Stampo la matrice for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { printf("%s\t", result[i][j]); } printf("\n"); }

Rispondi quotando
