Is it advisable to use strcmp or _tcscmp for comparing strings in Unicode versions?
相关问题
- Multiple sockets for clients to connect to
- What is the best way to do a search in a large fil
- Inheritance impossible in Windows Runtime Componen
- glDrawElements only draws half a quad
- how to get running process information in java?
No, you should use _
tcscmp
. That will resolve to proper function depending upon on your compiler flags._tcscmp()
is a macro. If you defineUNICODE
it will usewcscmp()
, otherwise it will usestrcmp()
.Note the types
TCHAR
,PTSTR
, etc. are similar. They will beWCHAR
andPWSTR
if you defineUNICODE
, andCHAR
andPSTR
otherwise.