SHARE
TWEET

Untitled

a guest Jun 19th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fp = fopen("studenci.txt", "r");
  2.     STUDENTL *h, *t;
  3.     STUDENTL *b, *P;
  4.     for (i = 0; i < n; i++) {
  5.         b = (STUDENTL*)malloc(sizeof(STUDENTL));
  6.         if (i == 0) {
  7.             b->p = (STUDENTL*)0;
  8.             h = b;
  9.         }
  10.         else b->p = P;
  11.         if (i > 0) P->n = b;
  12.         if (i == 4) {
  13.             b->n = (STUDENTL*)0;
  14.             t = b;
  15.         }
  16.         fgets(b->imie, 20, fp);
  17.         fgets(b->nazwisko, 30, fp);
  18.         fgets(buffer, 40, fp);
  19.         b->rok = atoi(buffer);
  20.         fgets(b->adres, 40, fp);
  21.         fgets(b->kod, 10, fp);
  22.         fgets(buffer, 40, fp);
  23.         b->stypendium = atof(buffer);
  24.         P = b;
  25.     }
  26.     fclose(fp);
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top