close a file
#include <stdio.h> int fclose( FILE *fp );
The fclose() function closes the file fp. If there is any unwritten buffered data for the file, it is written out before the file is closed. Any unread buffered data is discarded. If the associated buffer was automatically allocated, it is deallocated.
errno, fcloseall(), fdopen(), fopen(), freopen(), _fsopen()
#include <stdio.h> void main() { FILE *fp; fp = fopen( "stdio.h", "r" ); if( fp != NULL ) { fclose( fp ); } }
ANSI
All (except DOS/PM)