Advertisement
Pavle_nis

fajlovi 2

May 4th, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. // Fajlovi 3.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <stdio.h>
  6.  
  7. int main()
  8. {
  9.     int brojevi[50];
  10.     FILE *f = fopen("podaci.bin", "wb");
  11.     int i;
  12.  
  13.     for (i = 0; i < 5; i++)
  14.         scanf("%d", &brojevi[i]);
  15.  
  16.     fwrite(brojevi, sizeof(brojevi), 5, f);
  17.  
  18.     fclose(f);
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement