昆山建设企业网站,网络搭建是什么工作,深圳龙华外国语学校,网站丢失了怎么找回来文章目录 前言一、题目描述 二、解题 程序运行代码 总结 前言
本系列为字符串处理函数编程题#xff0c;点滴成长#xff0c;一起逆袭。 一、题目描述 二、解题
程序运行代码
#includestdio.h
#includestring.h
int main() {char *str1 hello wo… 文章目录 前言一、题目描述 二、解题 程序运行代码 总结 前言
本系列为字符串处理函数编程题点滴成长一起逆袭。 一、题目描述 二、解题
程序运行代码
#includestdio.h
#includestring.h
int main() {char *str1 hello world;char *str2 hello mike;if (strcmp(str1, str2) 0){printf(str1str2\n);}else if (strcmp(str1, str2) 0){printf(str1str2\n);}else{printf(str1str2\n);}return 0;
}总结 字符串比较函数 格式int strcmp字符串1地址字符串2地址) 比较两字符串的大小比较的是字符ASCII码大小。 字符串1字符串2函数的返回值为0 字符串1字符串2返回值为一正整数 字符串1字符串2返回值为一负整数