c语言 error C4996: 'strupr': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name
问题:
在使用visual studio 2013,进行调试执行代码时,出现如下错误:
error C4996: 'strupr': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant
name: _strupr. See online help for details.
解决办法:
在头文件尾部添加
#pragma warning(disable:4996)
报错消除
正确代码:
#include <stdio.h> #include <memory.h> #include <string.h> #pragma warning(disable:4996) void main() { char ss[] = "love china"; strupr(ss); /*把字符全部转为大写*/ printf("string ss:%s\n", ss); }
- 上一篇 »Job for php-fpm.service failed because the control process exited with error code. See "systemctl status php-fpm.service" and "journalctl -xe" for details.
- 下一篇 »Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. > java.io.IOException: Please correct the above warnings first.