//fopen_s()原型。正确返回0,不正确返回非0
_Check_return_wat_ _CRTIMP errno_t __cdecl fopen_s(
    _Outptr_result_maybenull_ FILE ** _File, //指向打开的FILE类型文件的指针变量的指针
    _In_z_ const char * _Filename, //文件名
    _In_z_ const char * _Mode); //使用文件方式
//fopen_s()示例
FILE *PFile;
char filePathNametmp[1024] = "c:\\test.txt";
if (fopen_s(&PFile, filePathNametmp, "rb") != 0)
{
    AfxMessageBox(_T("无法打开文件:"));
    return;
}

 

 

 

 

相关文章:

  • 2022-01-25
  • 2022-12-23
  • 2022-12-23
  • 2021-10-30
  • 2021-04-06
  • 2022-12-23
  • 2021-12-15
  • 2021-11-05
猜你喜欢
  • 2021-11-30
  • 2021-11-30
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
相关资源
相似解决方案