Reputation: 23
LPSTR a = LPSTR("hello"); how to convert a to LPCWSTR? string in C++ are confusing me, why methods use LPCWSTR and not just LPSTR D: I hope someone can provide a link where I can learn C++ strings
Upvotes: 0
Views: 704
Reputation: 1452
LPSTR
and LPCWSTR
are Windows specific types. They are not c++ strings, but char pointers alias which are C.
The STL - Standard Template Library - which is shipped with C++ provides a std::string
class, which is a convinient alias for basic_string<char, std::char_traits<char>, std::allocator<char>>
. See the documentation here.
Upvotes: 1