fcloseall
raw OCR
Closes open streams.
Defined in header <stdio.h>
Syntax
#include <stdio.h>
int fcloseall(void);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ | ■ |
Remarks
fcloseall closes all open streams except stdin, stdout, stdprn, stderr, and stdaux.
Return value
fcloseall returns the total number of streams it closed. It returns EOF if any errors were detected.
See also
Example
#include <stdio.h>
int main(void)
int streains_closed;
/* open two streams */
fopen("DUMMY.ONE", "w");
fopen("DUMMY.TWO", "w");
/* close the open streams */
streams_closed - fcloseall ();
if (streams_closed == EOF)
perror("Error"); /* issue an error message */
else /* print result of fcloseall() function */
printf("%d streams were closed. \n", streams_closed);
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/stdio.h/fcloseall/
· short form /3.1/fcloseall/