公告
财富商城
积分规则
提问
发文
2019-01-26 11:15发布
爱情/是我丢掉的垃圾
How can I convert 'wchar_t *' to 'const char *' ?
wchar_t
const char *
using C++ MFC VS2010.
Thank you.
As the question is about MFC, I would suggest the following:
CStringA a = "Test"; CStringW w = L"Test"; a = CStringA(w); w = CStringW(a);
I typically need the following conversions:
CString t = _T("Test"); // depends on TCHAR type a = CStringA(t); // does not depend on TCHAR type w = CStringW(t);
CStringW and CStringA have operators LPCWSTR and LPCSTR respectivelly.
最多设置5个标签!
As the question is about MFC, I would suggest the following:
I typically need the following conversions:
CStringW and CStringA have operators LPCWSTR and LPCSTR respectivelly.