Write a block of data to a stream: how to use fwrite
#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;
}
Related examples in the same category