2、我使用VS2012运用strupr函数进行字符串大小写转换时出现问题。在生成解决方案时提示1>e:\daily study\vs2012\cstring使用\cstring使用\cstring使
这是今天遇到的问题:(我用的是vs2010)
- swprintf( tempwcX, L"%s", tempStrX.c_str()); 修改成
- swprintf( tempwcX, 100, L"%s", tempStrX.c_str());
- swprintf( tempwcX, 100, L"%s", tempStrX.c_str());
2、在把VC6.0 工程转到VS2010工程中可能会遇到下面的问题
VS2010中,数学函数的参数检查更为严格,如pow(2, 45)会引起一个错误提示如下:
error C2668: “pow”: 对重载函数的调用不明确
d:\program files\microsoft visual studio 8\vc\include\math.h(575): 可能是“long double pow(long double,int)”
d:\program files\microsoft visual studio 8\vc\include\math.h(527): 或“float pow(float,int)”
d:\program files\microsoft visual studio 8\vc\include\math.h(489): 或“double pow(double,int)”
试图匹配参数列表“(int, int)”时
解决方法:
正确的使用为pow(2.0, 45)
3、d:\winccocxparam\winccocxparam\dom\simple_variant.h(320): warning C4996: 'wcsicmp': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _wcsicmp. See online
表示stricmp函数已经过时;
stricmp:POSIX标准中的名字;
_stricmp:ISO C++ 标准中的名字,且这些ISO标准的函数有许多安全版本,如:_cprintf_s;
在C++程序中,POSIX标准中的名字已经过时了,应该使用_stricmp取而代之,如果希望忽略此类warning,可以进行如下设置:【项目】->【项目属性】->【配置属性】->【C/C++】->【预处理器】->【预处理器定义】添加预定义宏:_CRT_NONSTDC_NO_DEPRECATE。