Skip to content

fclose : close a file

#include <stdio.h>
int fclose(FILE *fp);
```### Description
If the file or stream identified by fp is open, fclose closes it, after first ensuring that any pending data is written (by calling fflush(fp)).### Returns
fclose returns 0 if successful (including when fp is NULL or not an open file); otherwise, it returns EOF.
---
**Authoritative source**: BUSMASTER DITA help source `fclose.dita`, compiled into `BUSMASTER.CHM` with the application.