Advertisement



< Prev
Next >



C - Writing a file on Disk




In our last article, we have explained how to read an existing file on the disk. In this tutorial, we are going to explain how to write to a file on disk. For this, the C language provides us a structure called FILE, which is defined in the header file <conio.h>. The FILE structure allows us to create, read, write/modify the file on disk.

The FILE structure provides us a function named fopen(), using which we could provide location of the file stored on the disk and in return(if the file is found), the fopen() function open the file and gives us a pointer which is pointed at the position where the first character has to be written in the file.




Please Subscribe

Please subscribe to our social media channels for daily updates.


Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page




Advertisement



Notifications



Please check our latest addition

C#, PYTHON and DJANGO


Advertisement