开发者

How to close FILE* opened by _wfopen?

开发者 https://www.devze.com 2023-01-24 12:32 出处:网络
What\'s the counter part of _wfope开发者_如何转开发n? I found that there is fclose related to fopen, but it seems there is no _wfclose.I would say fclose(), since you don\'t actually need anything \"w

What's the counter part of _wfope开发者_如何转开发n? I found that there is fclose related to fopen, but it seems there is no _wfclose.


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.


Use the normal fclose to close the handle. _wfopen only opens "wide character" - you will get the same handle back from it as fopen.


if you check here http://msdn.microsoft.com/en-us/library/yeby3zcb(VS.71).aspx

_wfopen is a wide-character version of fopen, which means that the stream opened will be the same.

therefore you can use fclose (or even _fcloseall) to close it ^^

0

精彩评论

暂无评论...
验证码 换一张
取 消