5 réponses
Le langage n'étant pas précisé, je supposerais qu'il s'agit du C.
Une seule boucle suffit pour initialiser un tableau à deux dimensions (déclaré comme tel). Exemple:
Une seule boucle suffit pour initialiser un tableau à deux dimensions (déclaré comme tel). Exemple:
int i, tab[3][5];
for (i=0; i<3*5; i++)
tab[0][i] = 2; Si tu veux initialiser tout ton tableau à '0', tu peux simplement écrire:int tab[3][5] = { {0} };Bonne continuation.