Bon après-midi,
La joie des pointeurs, encore plus.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 size_t i; char *hashedbuff[1024] = {0}; struct nlist *np; for ( i = 0 ; i < HASHSIZE ; i++ ) { for ( np = table[i] ; np != NULL ; np = np->next ) { hashedbuff[i] = (char *) malloc (1 + strlen( np->name) * sizeof(char)); strcpy(hashedbuff[i], np->name); printf ( "tableauIfie\t\t%s", hashedbuff[i] ); } }
En dehors de la boucle, printf donne hashedbuff[0] = NULL
Je nage toujours ...
Partager