开发者

Is there a unified cout/wcout to handle char* and wchar*

开发者 https://www.devze.com 2023-02-04 07:30 出处:网络
I am not sur开发者_StackOverflow社区e if there is a unified way to handle char* and wchar* in Visual c++?A reasonably convenient way to handle both wchar and char strings is via bstr_t, which can be c

I am not sur开发者_StackOverflow社区e if there is a unified way to handle char* and wchar* in Visual c++?


A reasonably convenient way to handle both wchar and char strings is via bstr_t, which can be constructed from either and cast to either.

Under the covers, this class uses the required Win32 character conversion APIs to ensure correct output. It's really a COM helper class (BSTR is the COM string type), but no reason why you cannot use it even if you don't need COM.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号