diff --git a/ActivitesJour.don b/ActivitesJour.don index dd53725..7224ff2 100644 --- a/ActivitesJour.don +++ b/ActivitesJour.don @@ -1,2 +1,2 @@ Date nbActivitesJour -13/05/2022 120 +13052022 120 diff --git a/SAE.c b/SAE.c index a72435d..1f85ed6 100644 --- a/SAE.c +++ b/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() { } - +*/ diff --git a/SAE.h b/SAE.h index 2e98468..f8e73d7 100644 --- a/SAE.h +++ b/SAE.h @@ -2,7 +2,9 @@ #include int Ouverture(); +void testOuverture(); +/* int pointsBonus(); void sauvegarde(); int CreationAdherent(); -int FrequenceCentre(); \ No newline at end of file +int FrequenceCentre();*/ \ No newline at end of file diff --git a/exe b/exe new file mode 100755 index 0000000..9d74693 Binary files /dev/null and b/exe differ diff --git a/membres.don b/membres.don index 1d0d59a..8a686ff 100644 --- a/membres.don +++ b/membres.don @@ -1 +1 @@ -Ncarte nom prenom age pointsCarte carteActive nbActivitesJour +Ncarte age pointsCarte carteActive diff --git a/testSAE.c b/testSAE.c index aa58253..1b85ce7 100644 --- a/testSAE.c +++ b/testSAE.c @@ -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; } \ No newline at end of file