std::string to LPCTSTR

后端 未结 7 1343
甜味超标
甜味超标 2021-02-19 10:30

New version of the typical question of how to convert from std::string to LPCTSTR.

Reading from different SO posts I learnt that I should do th

7条回答
  •  时光说笑
    2021-02-19 11:12

    Use CreateDirectoryA instead. CreateDirectory is a macro that expands to either CreateDirectoryA or CreateDirectoryW depending on the build configuration; They take respectively LPCSTR and LPCWSTR. If you know you have a LPCSTR (which is what c_str() gives you), use the first one.

提交回复
热议问题