来就来吧
分类: C/C++
2011-04-23 23:45:19
Upon completion, strcmp() shall return an integer greater than, equal to, or less than 0, if the string pointed to by s1 is greater than, equal to, or less than the string pointed to by s2, respectively.
char *s1 = "abc";
char *s2 = "bcd";
一直以为 strcmp(*s1 , *s2) 返回是 > 0 的。
实际是小于0的。 因为他们之间是asscii的比较。
汗!