Zaibon

Untitled

Aug 4th, 2011
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.76 KB | None | 0 0
  1. hort validNomencalture(long number, long pto )
  2. {
  3.     short retour = 1;
  4.     FILE *pf = fopen(F_EXAMEN,"rb");
  5.     Examen Exam ;
  6.    
  7.     if(pf != NULL)
  8.     {
  9.         if( fseek(pf,pto,SEEK_SET) == 0 &&  (fread(&Exam,(long)sizeof(Examen),1,pf)  == 1) )
  10.         {
  11.                 while(retour == 1 && Exam.nomenclature != -1)
  12.                 {
  13.                     if(Exam.nomenclature == number)
  14.                         retour = 0;
  15.                     if(fseek(pf,Exam.offsetSvt,SEEK_SET) != 0 && fread(&Exam,sizeof(Examen),1,pf) != 1 )
  16.                         retour = 0;
  17.                 }
  18.         }
  19.          else
  20.                 retour = 0;
  21.       }
  22.    
  23.    
  24.     if(!retour)
  25.         printf("Erreur lecture du fichier %s\n",F_EXAMEN);
  26.    
  27.     return retour;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment