编译时报错 this function or variable may be unsafe 此类并非语法错误,而是 IDE默认禁止这种容易产生漏洞的旧函数 只需在预编译头加上: #pragma warning(disable:4996) 便可编译成功