Ajout du fichier membres et ActivitesJour à jour

master
Antoine PEREDERII 2 years ago
parent cea166d7eb
commit 2421523580

@ -1,2 +1,2 @@
Date nbActivitesJour
13/05/2022 120
13052022 120

16
SAE.c

@ -5,7 +5,7 @@ int Ouverture(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[]
int i = 0, j = 0;
int NoCarte, age, pointsCarte, CarteActive;
int Date, nbActivitesJour;
FILE *flot *jour;
FILE *flot, *jour;
flot = fopen("membres.don", "r");
jour = fopen("ActivitesJour.don", "r");
if(flot == NULL)
@ -18,8 +18,8 @@ int Ouverture(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[]
printf("Pb d'ouverture du fichier ActivitesJour.don\n");
return -1;
}
fscanf(flot, "%d%d%d%d%d%d%d", &NoCarte, &nom, &prenom, &age, &pointsCarte, &CarteActive, &nbActivitéesJour);
fscanf(jour, "%d%d", &Date, &nbActivitéesJour);
fscanf(flot, "%d%d%d%d%d%d%d", &NoCarte, &age, &pointsCarte, &CarteActive);
fscanf(jour, "%d%d", &Date, &nbActivitesJour);
while(!feof(flot))
{
if(i == tmax)
@ -32,7 +32,7 @@ int Ouverture(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[]
tage[i] = age;
tPointsCarte[i] = pointsCarte;
tCarteActive[i] = CarteActive;
fscanf(flot, "%d%d%d%d%d%d%d", &NoCarte, &nom, &prenom, &age, &pointsCarte, &CarteActive, &nbActivitéesJour);
fscanf(flot, "%d%d%d%d", &NoCarte, &age, &pointsCarte, &CarteActive);
i++;
}
while(!feof(jour))
@ -43,16 +43,16 @@ int Ouverture(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[]
fclose(jour);
return -1;
}
Date[j] = Date;
tDate[j] = Date;
tNbActivitesJour[j] = nbActivitesJour;
fscanf(jour, "%d%d", &Date, &nbActivitéesJour);
fscanf(jour, "%d%d", &Date, &nbActivitesJour);
j++;
}
fclose(jour);
fclose(flot);
return i;
}
/*
void pointsBonus()
{
@ -100,4 +100,4 @@ int FrequenceCentre()
{
}
*/

@ -2,7 +2,9 @@
#include <stdlib.h>
int Ouverture();
void testOuverture();
/*
int pointsBonus();
void sauvegarde();
int CreationAdherent();
int FrequenceCentre();
int FrequenceCentre();*/

BIN
exe

Binary file not shown.

@ -1 +1 @@
Ncarte nom prenom age pointsCarte carteActive nbActivitesJour
Ncarte age pointsCarte carteActive

@ -3,12 +3,17 @@
void testOuverture()
{
int tNoCarte[500], tage[500], tPointsCarte[500], tCarteActive[500];
int Date[500], tNbActivitesJour[500];
int tmax = 500, pas;
int tDate[500], tNbActivitesJour[500];
int tmax = 500, pas, i;
pas = Ouverture(tNoCarte, tage, tPointsCarte, tCarteActive, tNbActivitesJour, tDate, &tmax);
printf("Pas: %d", &pas);
printf("Ncarte nom prenom age pointsCarte carteActive nbActivitesJour\n");
for(i=0; i < pas; i++)
printf("\t%d\t%d\t%d\t%d\t%d\t%d\n", tNoCarte[i], tage[i], tPointsCarte[i], tCarteActive[i], tNbActivitesJour[i], tDate[i], &tmax);
}
int main(void)
{
testOuverture();
return 0;
}
Loading…
Cancel
Save