#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define ROW 2
#define COLUMN 4
int main()
{
int size,i,l,t,e;
int rows = 2;
int cols = 5;
int chars = 20;
int newrows;
char ***table = malloc(rows * sizeof(char **));
//alloco le righe
for (i = 0; i < rows; i++)
table[i] = malloc(cols * sizeof(char *));
//alloco ogni cella riga-colonna
for(i = 0; i < rows; i++)
for(l = 0; l < cols; l++)
table[i][l] = malloc(sizeof(char));
strcpy(table[0][0],"00");
strcpy(table[0][0],"00");
strcpy(table[0][1],"01");
strcpy(table[0][2],"02");
strcpy(table[0][3],"03");
strcpy(table[0][4],"04");
strcpy(table[1][0],"10");
strcpy(table[1][1],"11");
strcpy(table[1][2],"12");
strcpy(table[1][3],"13");
strcpy(table[1][4],"14");
//strcpy(table[2][0],"14"); //se decoentata va in errore di spazio seg fault
for (i = 0; i < rows; i++)
for(l=0;l< cols; l++)
{
if( (cols - 1) == l)
printf("%s\t\n",table[i][l]);
else
printf("%s\t",table[i][l]);
}
newrows = rows + 3;
//aumento il numero di righe
table = realloc(table,newrows * sizeof(char **));
table[2][0] = "01234567890123456789"; //DOVREBBE NON ANDARE IN ERRORE perchè ce piu spazio
printf("caratteri: %s\n",table[0][0]);
printf("Hello world!\n");
return 0;
}