Quantcast
Channel: Coding and Programing » string
Viewing all articles
Browse latest Browse all 10

convert std::string to LPCSTR

$
0
0

Problem And Question

How can I convert a std::string to LPCSTR? Also, how can I convert a std::string to LPWSTR?

I am totally confused with these LPCSTR LPSTR LPWSTR LPCWSTR?

Are LPWSTR and LPCWSTR are the same?

Best Solution And Answer

str.c_str() gives you a const char *, which is an LPCSTR (Long Pointer to Constant STRing) — means that it’s a pointer to a 0 terminated string of characters. W means wide string (composed of wchar_t instead of char).


Viewing all articles
Browse latest Browse all 10

Trending Articles