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.
73 lines
1.8 KiB
73 lines
1.8 KiB
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include "saelo.h"
|
|
|
|
char Card(void)//demande si client a la carte
|
|
{
|
|
char bCard;
|
|
printf("Avez-vous votre numéro de carte adhérent avec vous ?(O/N)\n");
|
|
scanf("%c", &bCard);
|
|
return bCard;
|
|
}
|
|
|
|
|
|
|
|
void Name( char *nom, char *prenom)//demande nom et prénom
|
|
{
|
|
printf("Dans ce cas, quel est votre nom ?\n");
|
|
scanf("%s%*c", nom);
|
|
printf("Et votre prénom ?\n");
|
|
scanf("%s%*c", prenom);
|
|
}
|
|
|
|
|
|
|
|
int Fillvar(FILE *f, int *numAd, char *fnom, char *fprenom, int *age, int *state, int *acti, int *passeoupas, int *ptsbought, int *ptsbonus, char *categ)//lis le fichier et met les valeurs dans les variables
|
|
{
|
|
if (feof(f))
|
|
{
|
|
return -1;
|
|
}
|
|
fscanf(f, "%6d\n", numAd);
|
|
fscanf(f, "%s", fnom);
|
|
fscanf(f, "%s", fprenom);
|
|
fscanf(f, "%2d", age);
|
|
fscanf(f, "%d", state);
|
|
fscanf(f, "%d", acti);
|
|
fscanf(f, "%d", passeoupas);
|
|
fscanf(f, "%2d", ptsbought);
|
|
fscanf(f, "%2d%*c", ptsbonus);
|
|
fscanf(f, "%c", categ);
|
|
}
|
|
|
|
/*
|
|
void ifnoCard(int *testnom, int *testpnom, int *erreur, char *fnom, char *fprenom, char *nom, char *prenom, FILE *f, int numAd, int age, int state, int acti, int passeoupas, int ptsbought, int ptsbonus, char categ)
|
|
{
|
|
|
|
puts("Recherche de la carte !");
|
|
|
|
testnom = strcmp(fnom, nom);//comparer nom du fichier et nom donné
|
|
testpnom = strcmp(fprenom, prenom);//comparer prénom du fichier et prénom donné
|
|
|
|
|
|
|
|
|
|
while (testnom!=0 && testpnom!=0 && erreur != -1)// tant que les 2 différents
|
|
{
|
|
erreur = Fillvar(f, &numAd, fnom, fprenom, &age, &state, &acti, &passeoupas, &ptsbought, &ptsbonus, &categ);//rescan
|
|
|
|
testnom = strcmp(fnom, nom);//recomparaison nom
|
|
testpnom = strcmp(fprenom, prenom);//recomparaison prénom
|
|
}
|
|
|
|
if(erreur == -1)
|
|
{
|
|
printf("Recherche non aboutie : numéro non enregistré...\n");//si le client n'est au final pas enregistré
|
|
return;
|
|
}
|
|
}
|
|
*/
|
|
|
|
|