fclose() – things to remember..

Home Forums C-programming.. fclose() – things to remember..

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2467 Reply
    Humble
    Keymaster

    fclose() can be used to close a stream.. How-ever please remember some facts about fclose().. When you call fclose() the buffered output is written and any buffered input is discarded.. Also its important to know the return value of fclose()..

    Upon successful completion 0 is returned. Otherwise, EOF is returned and errno is set to indicate the error. In either case any further
    access (including another call to fclose()) to the stream results in undefined behavior.

    The function fclose is declared in stdio.h.

    int fclose(FILE *fp);
    
    
Viewing 1 post (of 1 total)
Reply To: fclose() – things to remember..
Your information: