_close
Visual Studio .NET 2003
Closes a file.
int _close( int fd );
Parameter
- fd
- File descriptor referring to open file.
Return Value
_close returns 0 if the file was successfully closed. A return value of –1 indicates an error, in which case errno is set to EBADF, indicating an invalid file descriptor parameter.
Remarks
The _close function closes the file associated with fd.
Requirements
| Routine | Required header | Optional headers | Compatibility |
|---|---|---|---|
| _close | <io.h> | <errno.h> | Win 98, Win Me, Win NT, Win 2000, Win XP |
For additional compatibility information, see Compatibility in the Introduction.
Libraries
All versions of the C run-time libraries.
Example
See the example for _open.
See Also
Low-Level I/O Routines | _chsize | _creat | _dup | _open | _unlink | Run-Time Routines and .NET Framework Equivalents