Langage c
aboubacarassa
-
seo610 Messages postés 705 Statut Membre -
seo610 Messages postés 705 Statut Membre -
Bonjour, je vais savoir comment afficher un tableau en c ?
1 réponse
-
Simplement :
printf("%s\n", tableau);
Ou bien :char tableau[] = "hello, world" for (i = 0; i < strlen(tableau); i++) printf("%c", tableau[i]);
Ou encoreint i, j; int hauteur = 3; int longueur = 4; char tableau[3][4]; for (i = 0; i < hauteur; i++) for(j = 0; j < longueur; j++) tableau[i][j] = j < longueur-1 ? '*' : '\n'; for (i = 0; i < hauteur; i++) for(j = 0; j < longueur; j++) printf("%c", tableau[i][j]);