1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| codeLu = getchar();
while(codeLu != '0')
{
switch(codeLu)
{
case '1':
{
printf("\nRentrez le nouveau prenom : ");
fflush(stdin);
gets(prenomLu);
for(k=0; k<j; k=k+1)
{
if((strcmp(Tab[i].nom, Tab[k].nom) == 0))
{
if((strcmp(Tab[k].prenom, prenomLu) == 0))
break;
}
}
if(k<j)
printf("\nModification rejetee : la personne existe deja.\n");
else
strcpy(Tab[i].prenom, prenomLu);
printf("\nSi vous souhaitez effectuer une autre modification, rentrez 1, 2 ou 3, sinon rentrez 0 pour quitter.\n");
codeLu = getchar();
if(codeLu == '0')
printf("\nAffichage des nouvelles informations concernant la personne :\n\n\t%-25s %-25s %-15s %-10s\n\n", Tab[i].nom, Tab[i].prenom, Tab[i].tel, Tab[i].codeCat);
break;
}
case '2':
{
printf("\nRentrez le nouveau telephone : ");
fflush(stdin);
gets(telLu);
strcpy(Tab[i].tel, telLu);
printf("\nSi vous souhaitez effectuer une autre modification, rentrez 1, 2 ou 3, sinon rentrez 0 pour quitter.\n");
codeLu = getchar();
if(codeLu == '0')
printf("\nAffichage des nouvelles informations concernant la personne :\n\n\t%-25s %-25s %-15s %-10s\n\n", Tab[i].nom, Tab[i].prenom, Tab[i].tel, Tab[i].codeCat);
break;
}
case '3':
{
printf("\nRentrez la nouvelle categorie : ");
fflush(stdin);
gets(codeCatLu);
strcpy(Tab[i].codeCat, codeCatLu);
printf("\nSi vous souhaitez effectuer une autre modification, rentrez 1, 2 ou 3, sinon rentrez 0 pour quitter.\n\n");
codeLu = getchar();
if(codeLu == '0')
printf("\nAffichage des nouvelles informations concernant la personne :\n\n\t%-25s %-25s %-15s %-10s\n\n", Tab[i].nom, Tab[i].prenom, Tab[i].tel, Tab[i].codeCat);
break;
}
default:
{
printf("\nCode errone. Veuillez saisir a nouveau le code SVP.\n\n");
codeLu = getchar();
if(codeLu == '0')
printf("\nAffichage des nouvelles informations concernant la personne :\n\n\t%-25s %-25s %-15s %-10s\n\n", Tab[i].nom, Tab[i].prenom, Tab[i].tel, Tab[i].codeCat);
break;
}
}
} |
Partager