首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VC >

如何在VS2010下的VC++编译环境下,这句话出错呢。CString strSelectedFile=CString(30)

2012-02-03 
怎么在VS2010下的VC++编译环境下,这句话出错呢。CString strSelectedFileCString(30)CString strSelected

怎么在VS2010下的VC++编译环境下,这句话出错呢。CString strSelectedFile=CString(30);
CString strSelectedFile=CString(30); 提示错误

[解决办法]
请问这种写法规范吗?
CString strSelctedFile;就可以了。你的这种写法用在int上面是没问题的,后面的Cstring(30)一般是对字符串进行初始化的。而通过查看源码发现,CString并没有提供采用数值参数的搞糟函数.
CString();
CString(const CString& stringSrc);
CString(TCHAR ch, int nRepeat = 1);
CString(LPCSTR lpsz);
CString(LPCWSTR lpsz);
CString(LPCSTR lpch, int nLength);
CString(LPCWSTR lpch, int nLength);
CString(const unsigned char* psz);
[解决办法]

C# code
没有这样的构造CString strSelectedFile=CString("30"); 

热点排行