modifications ecommandées

master
antoine.perederii 2 years ago
parent 481a1cee76
commit efa6e4febb

@ -13,7 +13,7 @@
* \param nbElem taille logique du tableau * \param nbElem taille logique du tableau
* \param noCarte numéro de la carte à rechercher * \param noCarte numéro de la carte à rechercher
*/ */
int RechercheAjoutAdherent(int tNoCarte[], int nbElem, int noCarte) int RechercheAjoutAdherent(int tNoCarte[], int nbElem)
{ {
int i; int i;
while(i < nbElem) while(i < nbElem)
@ -47,13 +47,13 @@ int AjoutAdherent(int tNoCarte[], int tAge[], int tPointsCarte[], int tCarteActi
printf("Donnez l'âge de l'adhérent : "); printf("Donnez l'âge de l'adhérent : ");
scanf("%d", &age); scanf("%d", &age);
pas = RechercheAjoutAdherent(tNoCarte, nbElem, noCarte); pas = RechercheAjoutAdherent(tNoCarte, nbElem, noCarte);
for (j = nbElem; j > pas; j--)
{
if (j == tMax) if (j == tMax)
{ {
printf("Tableau plein, impossible d'ajouter un adhérent.\n"); /* Pas besoins de le mettre dans la boucle for */ printf("Tableau plein, impossible d'ajouter un adhérent.\n"); /* Pas besoins de le mettre dans la boucle for */
return -1; return -1;
} }
for (j = nbElem; j > pas; j--)
{
tNoCarte[j] = tNoCarte[j - 1]; tNoCarte[j] = tNoCarte[j - 1];
tAge[j] = tAge[j - 1]; tAge[j] = tAge[j - 1];
tPointsCarte[j] = tPointsCarte[j - 1]; tPointsCarte[j] = tPointsCarte[j - 1];

Loading…
Cancel
Save