why are the output files different when I use fwrite in another function VERSUS fwrite in the same function?
output1.txt contains garbage value like Ê, which is NOT corr
In function writeData change
fwrite(&buf, sizeof(char), strlen(buf), fp1);
to
fwrite(buf, sizeof(char), strlen(buf), fp1);