2019独角兽企业重金招聘Python工程师标准>>> 
#include <stdio.h>
#include <string.h>
int main(){
char str1[80], str2[80];
int x;
for(;;){
puts("nnInput the first string, a blank to exit: ");
gets(str1);
if(strlen(str1) == 0){
break;
}
puts("nInput the second string: ");
gets(str2);
// 比较输入的两个字符串并显示结果
x = strcmp(str1, str2);
printf("nstrcmp(%s, %s) returns %d", str1, str2, x);
}
return 0;
}
转载于:https://my.oschina.net/u/241930/blog/521397
最后
以上就是香蕉羽毛最近收集整理的关于使用strcmp()函数比较字符串的全部内容,更多相关使用strcmp()函数比较字符串内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复