Unable to write programs on files. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Unable to write programs on files.

I am unable to write c programs on files.can anyone give suggestions on it.

31st Oct 2018, 5:17 PM
khasimbabu shaik
khasimbabu shaik - avatar
1 Answer
+ 1
What exactly are your problems? You should provide my details. As for the general view, in C it works like this. You open a FILE object using fopen(), read/write to it using fread() and fwrite(), move in them using fseek() and close it using fclose() -- pretty intuitive if you ask me. The standard library also provides convinience functions wrapped around fread() and fwrite() (fprintf(), fputc(), fscanf(), fgetc() etc) to allow you to easily get data from, and put data to, a file.
31st Oct 2018, 8:15 PM
Vlad Serbu
Vlad Serbu - avatar