Advertisement
Guest User

5

a guest
Apr 24th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #define MAXLIN 80
  4.  
  5. int main (void) {
  6.  
  7. long m = 10L; double x[3] = {1.5, -3.5, 3.25};
  8. int n1, n2; FILE *izTok;
  9. izTok = fopen ("podaci", "wb");
  10. n1 = fwrite (&m, sizeof(m), 1, izTok);
  11.  
  12. if (n1 < 1) {
  13. printf("Zapisivanje nije uspjelo\n");
  14. exit(-1);
  15. }
  16.  
  17. n2 = fwrite (x, sizeof(x[0]), 3, izTok);
  18. if (n2 < 3) {
  19. printf("Zapisano je samo %d clanova\n", n2);
  20. exit(-2);
  21. }
  22.  
  23. fclose(izTok);
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement