Advertisement
edems96

hf1

Dec 1st, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1.  
  2. while( 1 ) {
  3.     adat * tmp = (adat *) malloc(sizeof(adat));
  4.    
  5.     if( !tmp )
  6.         break;
  7.        
  8.     if( fscanf(fp, "%s %s %s %s %s\n", tmp->vez, tmp->masodi, tmp->h, tmp->5, tmp->7) != 5 ) {
  9.         free(tmp);
  10.         break;
  11.     }
  12.    
  13.     if( elso == NULL ) {
  14.         elso    = tmp;
  15.         utolso  = tmp;
  16.     } else {
  17.         utolso->kov = tmp;
  18.         utolso      = tmp;
  19.     }
  20. }
  21.  
  22. return elso;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement