In this example, you will learn to write a sentence in a file using fprintf statement. To understand this example, you should have the knowledge of the following C programming topics:. In the program, the sentence entered by the user is stored in the sentence variable. Then, a file named program. If the file does not exist, it will be created.
In this tutorial, you will learn about file handling in C. Text files are the normal. You can easily create text files using any simple text editors such as Notepad. When you open those files, you'll see all the contents within the file as plain text. You can easily edit or delete the contents.