Advertisement
Guest User

Untitled

a guest
May 25th, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3.  
  4. typedef struct
  5. {
  6. char tip[10];
  7. float sekunda;
  8. float dinterval;
  9. float cinterval;
  10. }Poziv;
  11.  
  12. int ReadBin(char name[])
  13. {
  14. FILE *bin;
  15. Poziv p;
  16.  
  17. bin=fopen(name, "rb");
  18. if(bin==NULL) return -1;
  19.  
  20. while(1)
  21. {
  22. fread(&p, sizeof p, 1, bin);
  23. if(feof(bin))break;
  24. printf("%s, %.0f sek, %.3f, %.3f din\n", p.tip, p.sekunda, p.dinterval, p.cinterval);
  25. }
  26. fclose(bin);
  27. return 1;
  28. }
  29. int Racun(char name[])
  30. {
  31. FILE *bin;
  32. Poziv p;
  33. float cena;
  34.  
  35. bin=fopen(name, "rb");
  36. if(bin==NULL) return -1;
  37.  
  38. while(1)
  39. {
  40. fread(&p, sizeof p, 1, bin);
  41. if(feof(bin))break;
  42. if(p.tip=='odlazni')
  43. {
  44.  
  45. }
  46. }
  47. fclose(bin);
  48. return 1;
  49. }
  50.  
  51. main()
  52. {
  53. ReadBin("listing.bin");
  54. getch();
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement