Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <conio.h>
  4. #include <string.h>
  5.  
  6. typedef struct
  7. {
  8.     int canal;
  9.     char string[35];
  10.     float rating;
  11. } srat;
  12.  
  13. int main()
  14. {
  15.     FILE *f = fopen("rating.dat", "rb");
  16.  
  17.     srat in;
  18.  
  19.     while(!feof(f))
  20.     {
  21.         fread(&in, sizeof(srat), 1, f);
  22.  
  23.         printf("%i %s %f\n", in.canal, in.string, in.rating);
  24.     }
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement