First look at the source code of the fopen function under VS2017

Definition of fopen function under VS2017

 _Check_return_ _CRT_INSECURE_DEPRECATE(fopen_s)
    _ACRTIMP FILE* __cdecl fopen(
        _In_z_ char const* _FileName,
        _In_z_ char const* _Mode
        );

_ACRTIMP:
#define _ACRTIMP __declspec(dllimport) The macro definition declares the external function
FILE.
The return value of this function is the FILE structure pointer

In_z char const* _FileName
file path name whose type is char const*


The open mode type of In_z char const _Mode file is char const*
mode:

r Read only mode is on
w Write only mode on
a Open for writing, create if not, add data to the end of the file
r+ Read and write open
w+ Open for reading and writing, empty if it exists
a+ Read and write open. Remove the EOF mark first, and then reply to the EOF mark after the operation is complete.

Modes can be combined operation

I don’t understand other macro definitions for the time being, and I will add them later if I understand them. Or the great god tells me directly in the comments below.

Guess you like

Origin blog.csdn.net/weixin_50188452/article/details/115185672