Starting a new Windows app: Should I use _TCHAR or wchar_t for text?

前端 未结 5 2092
梦谈多话
梦谈多话 2021-01-06 04:01

I\'m coding up a new (personal hobby) app for Windows in c++.

In previous low-level Windows stuff I\'ve used _TCHAR (or just TCHAR) arrays/basic_strings

5条回答
  •  清歌不尽
    2021-01-06 04:38

    No there is not. Just go with wchar_t.

    TCHAR is only useful if you want to be able to use a conditional compilation switch to convert your program to operate in ASCII mode. Since Win2K and up are unicode platforms this switch does not provide any value. You'd instead be implying to other developers in your project that ASCII was a valid target when in fact it's not.

提交回复
热议问题