You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
873 B

#include "Fonctions.h"
int Sauvegarde(int tNoCarte[], int tAge[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int nbElem, int pasAct)
{
int i, j;
FILE *flot, *jour;
flot = fopen("membres.don", "w");
jour = fopen("ActivitesJour.don", "w");
if (flot == NULL)
{
printf("Problème d'ouverture du fichier membres.don en écriture.\n");
return -1;
}
if (jour == NULL)
{
printf("Problème d'ouverture du fichier ActivitesJour.don en écriture.\n");
return -1;
}
for (i = 0; i < (nbElem - 1); i++)
{
fprintf(flot, "\t%d\t%d\t\t%d\t\t%d\n", tNoCarte[i], tAge[i], tPointsCarte[i], tCarteActive[i]);
}
for (j = 0; j < (nbElem - 1); j++)
{
fprintf(jour, "%d\t\t%d\n", tDate[j], tNbActivitesJour[j]);
}
fclose(jour);
fclose(flot);
}