|
|
@ -46,6 +46,22 @@ candidat* LoadCandid(void)
|
|
|
|
return Tabcandidat;
|
|
|
|
return Tabcandidat;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SaveCandid(int nbcandidat,candidat *tcandidat)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//J'ouvre le fichier
|
|
|
|
|
|
|
|
FILE* file;
|
|
|
|
|
|
|
|
if((file=fopen("candid.bin","wb"))==NULL)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
perror("Erreur : ");
|
|
|
|
|
|
|
|
exit(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//J'écris le nombre d'étudiant que je rentres
|
|
|
|
|
|
|
|
fwrite(&nbcandidat,sizeof(int),1,file);
|
|
|
|
|
|
|
|
//J'écris tout mes étudiants
|
|
|
|
|
|
|
|
fwrite(tcandidat,sizeof(candidat),nbcandidat,file);
|
|
|
|
|
|
|
|
printf("Sauvegarde réussit");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void RechercheCandidat(int ID, int nbcandidat,candidat *tcandidat)
|
|
|
|
void RechercheCandidat(int ID, int nbcandidat,candidat *tcandidat)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for(int i=0;i<nbcandidat;++i)
|
|
|
|
for(int i=0;i<nbcandidat;++i)
|
|
|
|