Fermer2
bidooLe 05/06/2004 à 13:49
pourquoi le code ci-dessous bug-t-il de manière aléatoire?
char*** test(char ***tabl)
{
short i,j;
tabl = calloc (3,sizeof(**tabl)); 
for(i=0;i<3;i++) 
{ 
tabl[i]=calloc(4,sizeof(*tabl)); 
for(j=0;j<4;j++)tabl[i][j]=calloc(5,sizeof(char)); 
} 
strcpy(tabl[0][0],"aa");
return tabl;	
}
void _main(void)
{
char ***tabl=NULL;
tabl=test(tabl);
clrscr();
printf(tabl[0][0]);
 ngetchx();
free(tabl);
}

j'ai beau chercher, je ne trouve vraiment aucune erreur...