Tagged: file closing operation in C

Closing the File in C 2

Closing the File in C

Once we open a file, finished reading from the file, we need to close the file. This is done using the function fclose() through the statement: fclose(fp); Once we are done with closing the file, we can no longer read, write or perform any operation on the file unless we reopen it.  Note that to close the file, we don’t use the filename but the file pointer fp. On closing the file, the buffer associated with the file is removed from memory. While performing a write operation on a file, when we try to close the file using fclose(), three...

FREE C Cheatsheet - Speed Up Your C Programming.

FREE C Cheatsheet - Speed Up Your C Programming.

Download a 7-page free cheat sheet for easy and quick access to C Concepts, Snippets, and Syntax.

Thank you! Check you inbox and access your cheat-sheet