Problème avec for

Résolu
Scientophage Messages postés 15 Date d'inscription samedi 9 octobre 2004 Statut Membre Dernière intervention 21 février 2005 - 6 nov. 2004 à 22:09
Scientophage Messages postés 15 Date d'inscription samedi 9 octobre 2004 Statut Membre Dernière intervention 21 février 2005 - 6 nov. 2004 à 22:21
J'ai un gros problème avec l'instruction for quand je tape

int test[5];
for (int a=0; a==4; a++){
test[a]=a;
cout<<test[a];}

Ca ne m'affiche rien et en plus ça ne modifie pas mon tableau mais je n'ai aucune erreur. J'utilise dev cpp v4.9.9.0.

2 réponses

jeromedu94 Messages postés 83 Date d'inscription mardi 24 février 2004 Statut Membre Dernière intervention 10 mars 2006
6 nov. 2004 à 22:13
il faut faire for(a=0;a<=4;a++) pas for(a=0;a==4;a++)
3
Scientophage Messages postés 15 Date d'inscription samedi 9 octobre 2004 Statut Membre Dernière intervention 21 février 2005
6 nov. 2004 à 22:21
Merci ca marche maintenant
0
Rejoignez-nous