Advertisement
zsoltizbekk

Untitled

May 18th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4.  
  5. typedef struct eredmeny
  6. {
  7.   char nev[ 33 ];
  8.   char neptun[ 7 ];
  9.   int pont[ 5 ];
  10. }ELEM;
  11.  
  12.  
  13. int main(int argc, char *argv[])
  14. {
  15.     FILE *f;
  16.     int i;
  17.     f=fopen(argv[1], "rb");
  18.  
  19.     ELEM tmp;
  20.  
  21.     while(fread(&tmp,sizeof(ELEM),1,f))
  22.         for (i=0; i!=5; i++)
  23.             if (tmp.pont[i]==1)
  24.                 printf("%s (%s)", tmp.nev, tmp.neptun);
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement