#define _CRT_SECURE_NO_WARNINGS #include " stdafx.h " int main(){ FILE *pFile = fopen( " c:\\test.txt " , " w " ); putc( ‘ x ‘ , pFile); fclose(pFile); return 0 ;} // vc : 打开文件函数 - fopen FILE * fopen( const char * filename,
#define _CRT_SECURE_NO_WARNINGS #include "stdafx.h" int main() { FILE *pFile = fopen("c:\\test.txt", "w"); putc(‘x‘, pFile); fclose(pFile); return 0; }
// vc : 打开文件函数 - fopen FILE *fopen( const char *filename, const char *mode ); // vs : 打开文件函数 - fopen_s errno_t fopen_s( FILE** pFile, const char *filename, const char *mode ); // 解决方法 - 添加预处理 #define _CRT_SECURE_NO_WARNINGS