我想连接一个std::string
和WCHAR*
,结果应该是WCHAR*
。C++ /串连的std :: string和WCHAR *至* WCHAR
我尝试下面的代码
size_t needed = ::mbstowcs(NULL,&input[0],input.length());
std::wstring output;
output.resize(needed);
::mbstowcs(&output[0],&input[0],input.length());
const wchar_t wchar1 = output.c_str();
const wchar_t * ptr=wcsncat(wchar1, L" program", 3);
我得到了以下错误
错误C2220:警告视为错误 - 没有 '对象' 文件生成
错误C2664: 'wcsncat' :不能将参数1从'const wchar_t *'转换为'wchar_t *'
这很好。你尝试过什么吗? – Rapptz 2013-03-01 05:10:44
你不受欢迎。尝试一下,向我们展示一些努力或使用示例,然后编辑您的问题。 :3c – 2013-03-01 05:12:27
yes ma..ha..aster(* squeeking sound *)... maste ... ma .. ma .. – 2013-03-01 05:12:42