O'Reilly logo
  • Ivan Petrov thinks this is interesting:

Writing Binary Data

Individual characters and lines will not cut it when programs need to write complex data. To directly store binary data such as C variables, standard I/O provides fwrite( ):

#include <stdio.h>

size_t fwrite (void *buf,
               size_t size,
               size_t nr,
               FILE *stream);


Cover of Linux System Programming


Writing binary data with fwrite, writing string with fputs, character with fputc