VS2012 中strupr函数的问题

JabinYan-TradeOff 2014-03-17 08:31:30
我使用VS2012运用strupr函数进行字符串大小写转换时出现问题。在生成解决方案时提示1>e:\daily study\vs2012\cstring使用\cstring使用\cstring使用.cpp(19): error C4996: 'strupr': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strupr. See online help for details.
好像在说strupr使用方式过期之类的。该怎么修改呐?新手上路,跪求高手指导!
...全文
762 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
w2011101 2014-05-12
  • 打赏
  • 举报
回复
您好:
我这句也为啥出现错误了??

代码: strstr(_strupr_s(s),"LL")
赵4老师 2014-03-18
  • 打赏
  • 举报
回复
Locale Use the setlocale function to change or query some or all of the current program locale information. “Locale” refers to the locality (the country and language) for which you can customize certain aspects of your program. Some locale-dependent categories include the formatting of dates and the display format for monetary values. For more information, see Locale Categories. Locale-Dependent Routines Routine Use setlocale Category Setting Dependence atof, atoi, atol Convert character to floating-point, integer, or long integer value, respectively LC_NUMERIC is Routines Test given integer for particular condition. LC_CTYPE isleadbyte Test for lead byte () LC_CTYPE localeconv Read appropriate values for formatting numeric quantities LC_MONETARY, LC_NUMERIC MB_CUR_MAX Maximum length in bytes of any multibyte character in current locale (macro defined in STDLIB.H) LC_CTYPE _mbccpy Copy one multibyte character LC_CTYPE _mbclen Return length, in bytes, of given multibyte character LC_CTYPE mblen Validate and return number of bytes in multibyte character LC_CTYPE _mbstrlen For multibyte-character strings: validate each character in string; return string length LC_CTYPE mbstowcs Convert sequence of multibyte characters to corresponding sequence of wide characters LC_CTYPE mbtowc Convert multibyte character to corresponding wide character LC_CTYPE printf functions Write formatted output LC_NUMERIC (determines radix character output) scanf functions Read formatted input LC_NUMERIC (determines radix character recognition) setlocale, _wsetlocale Select locale for program Not applicable strcoll, wcscoll Compare characters of two strings LC_COLLATE _stricoll, _wcsicoll Compare characters of two strings (case insensitive) LC_COLLATE _strncoll, _wcsncoll Compare first n characters of two strings LC_COLLATE _strnicoll, _wcsnicoll Compare first n characters of two strings (case insensitive) LC_COLLATE strftime, wcsftime Format date and time value according to supplied format argument LC_TIME _strlwr Convert, in place, each uppercase letter in given string to lowercase LC_CTYPE strtod, wcstod, strtol, wcstol, strtoul, wcstoul Convert character string to double, long, or unsigned long value LC_NUMERIC (determines radix character recognition) _strupr Convert, in place, each lowercase letter in string to uppercase LC_CTYPE strxfrm, wcsxfrm Transform string into collated form according to locale LC_COLLATE tolower, towlower Convert given character to corresponding lowercase character LC_CTYPE toupper, towupper Convert given character to corresponding uppercase letter LC_CTYPE wcstombs Convert sequence of wide characters to corresponding sequence of multibyte characters LC_CTYPE wctomb Convert wide character to corresponding multibyte character LC_CTYPE _wtoi, _wtol Convert wide-character string to int or long LC_NUMERIC
沙尘暗影 2014-03-18
  • 打赏
  • 举报
回复
最好是自写一个,免去过期的烦恼
JabinYan-TradeOff 2014-03-18
  • 打赏
  • 举报
回复
引用 7 楼 zhao4zhong1 的回复:
在代码最前面加一行:
#pragma warning(disable:4996)
多谢!真的解决问题了,但是运行的时候还是有点小问题。不过还是万分感谢!
赵4老师 2014-03-18
  • 打赏
  • 举报
回复
在代码最前面加一行:
#pragma warning(disable:4996)
JabinYan-TradeOff 2014-03-18
  • 打赏
  • 举报
回复
引用 1 楼 tujiaw 的回复:
用:_strupr_s
if(strcmp(strupr(input),password)==0) 这一句的strupr需要修改为_strupr_s吗?改了之后编译时又会报错。
JabinYan-TradeOff 2014-03-18
  • 打赏
  • 举报
回复
引用 2 楼 dizuo 的回复:
也可以自己写一个大写转小写函数。
谢谢高手建议,这是现在刚入门,还不会自己写,就是对着教材敲的这个程序,结果出了问题,不知道怎么修改。
ryfdizuo 2014-03-17
  • 打赏
  • 举报
回复
也可以自己写一个大写转小写函数。
ningto.com 2014-03-17
  • 打赏
  • 举报
回复
用:_strupr_s

64,654

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧