Posted on 2012-09-20 15:15
盛勝 閱讀(5138)
評論(0) 編輯 收藏 引用 所屬分類:
ftp客戶端
int _stricmp( const char *string1, const char *string2 );
strcmp 用來比較ANSI字符串,而_tcscmp用 來比較UNICODE(寬字符)的字符串。ANSI字符串中,1個英文字母為1個字節,1個中文字符為2個字節,遇到0字符表示字符串結束。而在 UNICODE(寬字符)中,所有的字符都為2個字節,此時字符串中間的字節,可能含有0字符,此時就不能用strcmp比較了。strcmp(char *s1, char *s2) : 按照各個字符(ascii)比較s1和s2,相等則返回0,否則返回ascii相減的結果。
int _stricmp(
const char *string1,
const char *string2
);
Return value |
Description |
< 0 |
string1 less than string2 |
0 |
string1 identical to string2 |
> 0 |
string1 greater than string2 |