Bonjour tout le monde
J'ai un probleme avec le critere d'arret d'une boucle while.
je ne sais pas quoi mettre, je souhaite que la boucle s'arrette quand on entre saise vide dans section.
Voici le code:
while(c.section!=0){
printf("Entrer le numero de la section\n");
scanf("%d",&c.section);
fwrite( &c.section, sizeof(int) ,sizeof(c.section), fich );
printf("Entrer le nom\n");
scanf("%s",&c.nom);
fwrite( &c.nom, sizeof(char) ,sizeof(c.nom), fich );
printf("Entrer le Prenom\n");
scanf("%s",&c.prenom);
fwrite( &c.prenom, sizeof(char) ,sizeof(c.prenom), fich );
}
cwhile(c.section==-1){
printf("Entrer le numero de la section\n");
scanf("%d",&c.section);
fwrite( &c.section, sizeof(int) ,sizeof(c.section), fich );
printf("Entrer le nom\n");
scanf("%s",&c.nom);
fwrite( &c.nom, sizeof(char) ,sizeof(c.nom), fich );
printf("Entrer le Prenom\n");
scanf("%s",&c.prenom);
fwrite( &c.prenom, sizeof(char) ,sizeof(c.prenom), fich );
}
Pouvez vous m'aider.
Merci
Cordialement
A bientôt