#include #include #include "sae.h" int creeadherent(int *tNC,char *tN,char *tPR,int *tA,int *tCA,int *tPO, int Tmax) { int NC,N,PR,A,CA,PO, i=0; FILE *fe; fe=fopen("adherent.txt","r"); if(fe == NULL) { printf("pbouvrfichier\n"); return -1; } fscanf(fe,"%d %s %s %d %d %d",&NC,&N,&PR,&A,&CA,&PO); while (!feof(fe)) { if(i==Tmax) { printf("%d \t %d\n",i, Tmax); printf("capasité atteinte\n"); fclose(fe); return -1; } tNC[i]=NC; tN[i]=N; tPR[i]=PR; tA[i]=A; tCA[i]=CA; tPO[i]=PO; i++; fscanf(fe,"%d %s %s %d %d %d",&NC,&N,&PR,&A,&CA,&PO); } fclose(fe); return i; } void affichageA(int *tNC,char *tN,char *tPR,int *tA,int *tCA,int *tPO, int n) { int i; printf("----------------------------------------------------------------------------\n"); printf("n°client nom\t prenom\t age\t carte\t point\n"); for (i=0;i