How does the fopen function work?

If successful, the fopen () function returns a pointer to the FILE object that controls the opened file stream. On failure, it returns a null pointer. When you run the program, it will not generate any output but will write “Hello World!” to the file “file.txt”. When you run the program, the output will be [Assuming the same file as in Example 1]:
For More Information Please Refer:

You May Also Like to Read: