flavour404
flavour404

Reputation: 6312

How do you convert LPCWSTR to const char *?

How do you convert LPCWSTR to const char *?

Thanks

Upvotes: 6

Views: 10681

Answers (2)

Red5
Red5

Reputation: 21

You can also have a look at wcstombs_s

Upvotes: 2

Greg Hewgill
Greg Hewgill

Reputation: 994401

Use the WideCharToMultiByte function.

Note that LPCWSTR is the same as const wchar_t *, so if you're dealing with wide character data throughout your application, you may not need to convert it at all.

Upvotes: 12

Related Questions