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