strcmp-字符串比较函数
原型:int strcmp(const char firststring[], const char secondstring);
功能:比较两个字符串firststring和secondstring
如果等于 返回值为0
如果字符串1大于字符串2 函数值返回为1
如果字符串1小于字符串2 函数值返回为-1
#include<stdio.h>
#include<string.h>
void main()
{
char str1[]="coffee";
char str2[]="tea";
char str3[]="abc";
int result1=strcmp(str1,str2);
int result2=strcmp(str1,str3);
printf("%d\n",result1);
printf("%d\n",result2);
}