当前位置:网站首页>(指針)自己寫一個比較字符串大小的函數,功能與strcmp類似。
(指針)自己寫一個比較字符串大小的函數,功能與strcmp類似。
2022-07-04 04:19:00 【我不是蕭海哇~~~~】
int strcmps(const char *s1,const char *s2)
{
while(*s1!='\0'&& *s2!='\0')
{
if(*s1>*s2)
return 1;
else if(*s1<*s2)
return -1;
s1++;
s2++;
}
if(*s1>*s2)
return 1;
else if(*s1<*s2)
return -1;
return 0;
}
边栏推荐
- TCP-三次握手和四次挥手简单理解
- How to dynamically cache components in Vue multi-level route nesting
- 01 qemu 启动编译好的镜像 VFS: Unable to mount root fs on unknown-block(0,0)
- Why is the probability of pod increasing after IPtable
- Unity 绘制弹球和台球的运动轨迹
- Mitsubishi M70 macro variable reading Mitsubishi M80 public variable acquisition Mitsubishi CNC variable reading acquisition Mitsubishi CNC remote tool compensation Mitsubishi machine tool online tool
- CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
- Idea configuration 360zip open by default -- external tools
- Flink学习6:编程模型
- ctf-pikachu-XSS
猜你喜欢
PostgreSQL users cannot create table configurations by themselves
Flink learning 7: application structure
毕业设计:设计秒杀电商系统
PPt 教程,如何在 PowerPoint 中将演示文稿另存为 PDF 文件?
函数计算异步任务能力介绍 - 任务触发去重
Katalon中控件的参数化
My opinion on how to effectively telecommute | community essay solicitation
'2'&gt;' 10'==true? How does JS perform implicit type conversion?
Flink学习8:数据的一致性
北漂程序员,月薪20K,一年攒15W,正常吗?
随机推荐
干货!基于GAN的稀有样本生成
RHCSA 07 - 用户与群组管理
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
PPt 教程,如何在 PowerPoint 中将演示文稿另存为 PDF 文件?
CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
Myslq delete followed by limit
分布式系统:what、why、how
postgresql 用户不能自己创建表格配置
Pointer array and array pointer
[paddleseg source code reading] paddleseg calculates Miou
[paddleseg source code reading] paddleseg calculation dice
I was tortured by my colleague's null pointer for a long time, and finally learned how to deal with null pointer
Getting started with the go language is simple: go implements the Caesar password
还原窗口位置的微妙之处
Katalon使用script实现查询List大小
Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure
Pytest multi process / multi thread execution test case
DP83848+网线热拔插
Lnk2038 detected a mismatch of "runtimelibrary": the value "md_dynamicrelease" does not match the value "mdd_dynamicdebug" (in main.obj)
程序员远程办公喜忧参半| 社区征文