How to convert a TCHAR array to std::string?

后端 未结 6 1521
孤街浪徒
孤街浪徒 2020-12-06 09:14

How do I convert a TCHAR array to std::string (not to std::basic_string)?

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-06 10:01

    TCHAR is either char or wchar_t, so a

    typedef basic_string   tstring;
    

    is one way of doing it.

    The other is to skip char altogether and just use std::wstring.

提交回复
热议问题