| 
 
 4195| 2
 
 | 
C指针数组 strcmp使用问题 | 
| 
 
5鱼币 
 最佳答案1.函数简介
原型:extern int strcmp(const char *s1,const char * s2);
所在头文件:string.h
功能:比较字符串s1和s2。
一般形式:strcmp(字符串1,字符串2)
说明:
当s1s2时,返回正数 注意不是1
即:两个字符串自左向右逐个字符相比(按ASCII值大小相比较),直到出现不同的字符或遇'\0'为止。如:
"A""A" "computer">"compare"
特别注意:strcmp(const char *s1,const char * s2)这里面只能比较字符串,不能比较数 ... 
 | ||
| 
 小甲鱼最新课程 -> https://ilovefishc.com 
 | 
||
  | ||
| 
 小甲鱼最新课程 -> https://ilovefishc.com 
 | 
||
 评分 | ||
| 
 小甲鱼最新课程 -> https://ilovefishc.com 
 | 
||
小黑屋|手机版|Archiver|鱼C工作室
( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)
GMT+8, 2025-11-4 19:28
Powered by Discuz! X3.4
© 2001-2023 Discuz! Team.