Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- short validNomencalture(long number, long pto )
- {
- short retour = 1;
- FILE *pf = fopen(F_EXAMEN,"rb");
- Examen *pExam = NULL;
- if(pf != NULL)
- {
- if( fseek(pf,pto,SEEK_SET) == 0 && (fread(pExam,(long)sizeof(Examen),1,pf) == 1) )
- {
- while(retour == 1 && pExam->nomenclature != -1)
- {
- if(pExam->nomenclature == number)
- retour = 0;
- if(fseek(pf,pExam->offsetSvt,SEEK_SET) != 0 && fread(pExam,sizeof(Examen),1,pf) != 1 )
- retour = 0;
- }
- }
- else
- retour = 0;
- }
- if(!retour)
- printf("Erreur lecture du fichier %s\n",F_EXAMEN);
- return retour;
- }
Advertisement
Add Comment
Please, Sign In to add comment