2.3 Closing Files
close
To disassociate a logical program file from a physical system file.
Closing a file frees system resources for reuse.
Data may not be actually written to the physical file until a logical file is closed.
A program should close a file when it is no longer needed.
The C++ close function is used to close a file for handle level access.
The handle close function must be supplied with (as an argument):
o The handle of the logical file
The value returned by the close is 0 if the close succeeds, and -1 if the close fails..
Prototypes:
int close (int Handle);
Example:
close (Input);
To disassociate a logical program file from a physical system file.
Closing a file frees system resources for reuse.
Data may not be actually written to the physical file until a logical file is closed.
A program should close a file when it is no longer needed.
The C++ close function is used to close a file for handle level access.
The handle close function must be supplied with (as an argument):
o The handle of the logical file
The value returned by the close is 0 if the close succeeds, and -1 if the close fails..
Prototypes:
int close (int Handle);
Example:
close (Input);