C ++ lpcwstr转换为wstring [英] C++ lpcwstr to wstring

查看:103
本文介绍了C ++ lpcwstr转换为wstring的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在C ++(VS 2010)中将LPCWSTR转换为wstring.我想在OutputDebugStringW()中使用它.

I would like to convert a LPCWSTR to wstring in C++ (VS 2010). I want to use this in OutputDebugStringW().

谢谢.

推荐答案

只需将 LPCWSTR 传递给 wstring 的构造函数,如下所示:

Well just pass the LPCWSTR to the constructor of wstring like this:

LPCWSTR str=L"fun";
wstring str2(str);

这篇关于C ++ lpcwstr转换为wstring的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆