开发者

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

开发者 https://www.devze.com 2022-12-17 09:59 出处:网络
Is it advisabl开发者_高级运维e to use strcmp or _tcscmp for comparing strings in Unicode versions?_tcscmp() is a macro.If you define UNICODE it will use wcscmp(), otherwise it will use strcmp().

Is it advisabl开发者_高级运维e to use strcmp or _tcscmp for comparing strings in Unicode versions?


_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.


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

0

精彩评论

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