Advertisement
Guest User

Wczytaj

a guest
Jan 31st, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. void Wczytaj(ADRESB first, ADRESDK pierwszy)
  2. {
  3. ADRESB tmp, help;
  4. Biblioteka b;
  5. ADRESDK pom, rat;
  6. DoKupienia d;
  7. char nowyplik[50];
  8. printf("dsa");
  9. FILE *food = fopen(nazwa,"rb");
  10.  
  11. while(fread(&b, sizeof(Biblioteka), 1, food) == 1)
  12. {
  13. tmp=(LISTAB*)malloc(sizeof(LISTAB));
  14. strcpy(tmp->data.AutorB, b.AutorB);
  15. strcpy(tmp->data.TytulB, b.TytulB);
  16. tmp->data.Rok = b.Rok;
  17. strcpy(tmp->data.Wydawnictwo, b.Wydawnictwo);
  18. strcpy(tmp->data.Wypozyczona, b.Wypozyczona);
  19. strcpy(tmp->data.Komu, b.Komu);
  20. strcpy(tmp->data.Typ, b.Typ);
  21. tmp->next = NULL;
  22.  
  23. first->next = tmp;
  24. first = tmp;
  25. }
  26.  
  27. while(fread(&d, sizeof(DoKupienia), 1, food) == 1)
  28. {
  29.  
  30. strcpy(pom->dane.AutorDK, d.AutorDK);
  31. strcpy(pom->dane.TytulDK, d.TytulDK);
  32.  
  33. pom->nast = NULL;
  34.  
  35. pierwszy->nast = pom;
  36. pierwszy = pom;
  37. }
  38.  
  39. printf("Udalo sie otworzyc plik\n\nWcisnij dowolny klawisz aby kontynuowac.\n");
  40. getch();
  41. system("cls");
  42.  
  43. return;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement