Zaibon

Untitled

May 5th, 2011
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. void Init_Chantiers()
  2. {
  3. FILE *fp;
  4. _Chantiers pc;
  5. short cpt;
  6.  
  7. fp = fopen(FICHIERCHANTIER, "rb");
  8. if(fp == NULL)
  9. {
  10.     pc.numchantier = -1;
  11.     pc.montant = 0;
  12.     fp = fopen(FICHIERCHANTIER, "wb");
  13.     for(cpt = 0; cpt < NB_CHANTIERS; cpt++)
  14.     {
  15.         pc.offsetsuiv = ftell(fp)+ sizeof(_Chantiers);
  16.         fwrite(&pc,sizeof(_Chantiers),1,fp);
  17.     }
  18. }
  19. fclose(fp);
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment