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
writeData() should call fwrite(buf, ...) not fwrite(&buf, ...)