Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main (int argc, char **argv) {
  4.     int integers[4] = { 1, 2, 3, 4};
  5.     int arrayLength = 4;
  6.  
  7.     FILE *f = fopen ("file.bin", "wb");
  8.     fwrite (&arrayLength, sizeof (int), 1, f);
  9.     fwrite (integers, sizeof (int), arrayLength, f);
  10.     fclose (f);
  11.     return 0;
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement