Retourner au contenu associé (entrée de forum : valeur NULL d'un tableau de pointeur)
Posté par cho7 (site web personnel) le 18 septembre 2006 à 15:46. En réponse au message valeur NULL d'un tableau de pointeur. Évalué à 2.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
# beh euh...
Posté par cho7 (site web personnel) . En réponse au message valeur NULL d'un tableau de pointeur. Évalué à 2.
int main(int argc, char **argv){
char tab[5][255];
int i;
for (i = 0; i< 5; i++)
tab[i][0] = NULL;
strcpy(tab [0],"plop");
strcpy(tab [1],"poulpe");
int n = 0;
while (tab[n][0] != NULL){
printf("%s\n",tab[n]);
n++;
}
return 0;
}
Pas testé, mais bon, ca devrait tourner (à caster si tu veux pas de warning...)