Chinaunix首页 | 论坛 | 博客
  • 博客访问: 169403
  • 博文数量: 49
  • 博客积分: 2802
  • 博客等级: 大尉
  • 技术积分: 502
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-25 12:02
个人简介

来就来吧

文章分类

全部博文(49)

文章存档

2014年(1)

2012年(1)

2011年(11)

2010年(26)

2009年(10)

分类: C/C++

2011-04-23 23:45:19

RETURN VALUE

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的比较。

汗!
阅读(954) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~