- 1). Right-click the C source code file you want to edit and select "Open With." Click the C compiler you want to use to edit the code.
- 2). Locate the part of the file that uses the C file handlers. You place the "fclose" function at the very end of the function that opens the file.
- 3). Type the following code to close a file handler:
int response;
response = fclose( file );
Replace "file" with your own file variable. The "response" variable contains a success integer, which is a zero. If the file does not close, an error number is returned.
previous post