c语言,strcmp(),字符串比较,看Asic 码,str1>str2,返回值 > 0;两串相等,返回

#include<stdio.h>
#include<string.h>
int main()
{
 char *buffer1="aaa",*buffer2="bbb",*buffer3="ccc";
 int pos;
 pos=strcmp(buffer1,buffer2);
 
 if(pos>0)
 {
    printf("2>1\n");
  }
  else
  {
    printf("1>2\n");
   }
 pos=strcmp(buffer2,buffer3);
 if(pos>0)
 {
    printf("2>3\n");
  }
  else
  {
    printf("3>2\n");
   }

 return 0;
}
posted @ 2013-07-15 20:13  shouqiang Wei  阅读(320)  评论(0编辑  收藏  举报