Write the syntax and explain the purpose of the following functions : Fclose() 2m Dec2005

By | June 10, 2014

Write the syntax and explain the purpose of the following functions : 2m Dec2005

(ii) Fclose( )

Description

The C library function int fclose(FILE *stream) closes the stream. All buffers are flushed.

Declaration

Following is the declaration for fclose() function.

[codesyntax lang="c"]
int fclose(FILE *stream)
[/codesyntax]Parameters
  • stream — This is the pointer to a FILE object that specifies the stream to be closed.

Return Value

This method returns zero if the stream is successfully closed.On failure, EOF is returned.

Leave a Reply