What's the counter part of _wfopen? I found that there is fclose related to fopen, but it seems there is no _wfclose.
fopen () function creates a new file or opens an existing file. fclose () function closes an opened file.
In a large program, which runs on long after you have finished reading/writing to the file, not closing it means that your program is still holding the resource. This means that other processes cannot acquire that file until your program terminates (which may not be what you wish for).
w - opens or create a text file in write mode. a - opens a file in append mode. r+ - opens a file in both read and write mode. a+ - opens a file in both read and write mode. w+ - opens a file in both read and write mode.
I would say fclose()
, since you don't actually need anything "wide" in order to close it.
fclose()
.
Yup, it's that simple. It's just a file handle under the hood.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With