Is it advisable to use strcmp or _tcscmp for compa

2019-06-16 10:43发布

Is it advisable to use strcmp or _tcscmp for comparing strings in Unicode versions?

2条回答
放荡不羁爱自由
2楼-- · 2019-06-16 11:22

No, you should use _tcscmp . That will resolve to proper function depending upon on your compiler flags.

查看更多
不美不萌又怎样
3楼-- · 2019-06-16 11:36

_tcscmp() is a macro. If you define UNICODE it will use wcscmp(), otherwise it will use strcmp().

Note the types TCHAR, PTSTR, etc. are similar. They will be WCHAR and PWSTR if you define UNICODE, and CHAR and PSTR otherwise.

查看更多
登录 后发表回答