if((cfPtr = fopen("test.dat","w")) == NULL) //若cfPtr = NULL,即文件未成功打开,函数返回0,否则返回1 return 0; else return 1; fopen_s: 原型: errno_t fopen_s( FILE** pFile, const char *filename, const char *mode ); errno_t _wfopen_s( FILE** pFile, const wchar_t *file...