Mega Code Archive

 
Categories / C / File
 

Write a block of data to a stream

#include <stdio.h> int main () {   FILE *file;   char str[] = "This buffer contains 34 characters";   file = fopen ("my.txt" , "w");   fwrite (str , 1 , 34 , file);   fclose (file);   return 0; }