fclose

Full prototype:

int fclose(FILE*);  

Purpose and Notes:

Closes the stream passed in as the sole argument after flushing any remaining buffered data for it.

Returns:

int- The function returns zero if the stream was closed successfully and EOF otherwise.

Argument 1:

FILE*- The file pointer to the file in which you want to close.

Example 1