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

ckv picture ckv · Jan 21, 2010 · Viewed 16.8k times · Source

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

Answer

asveikau picture asveikau · Jan 21, 2010

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