当前位置:网站首页>(指针)自己写一个比较字符串大小的函数,功能与strcmp类似。
(指针)自己写一个比较字符串大小的函数,功能与strcmp类似。
2022-07-04 03:51: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;
}
边栏推荐
- pytest多进程/多线程执行测试用例
- 毕业设计:设计秒杀电商系统
- Katalon uses script to query list size
- Objective-C string class, array class
- Graduation summary
- Katalon使用script实现查询List大小
- 三菱M70宏变量读取三菱M80公共变量采集三菱CNC变量读取采集三菱CNC远程刀补三菱机床在线刀补三菱数控在线测量
- [untitled]
- CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
- A review of reverse reinforcement learning at Virginia Tech (VT)
猜你喜欢
随机推荐
Katalon framework test web (XXVI) automatic email
Mindmanager2022 efficient and easy to use office mind map MindManager
postgresql 用户不能自己创建表格配置
There is a problem that the package cannot be parsed in the like project
Redis cluster view the slots of each node
线程常用的方法
毕业三年,远程半年 | 社区征文
A review of reverse reinforcement learning at Virginia Tech (VT)
vim正确加区间注释
VIM mapping command
【微服务|openfeign】@FeignClient详解
Redis cluster uses Lua script. Lua script can also be used for different slots
Objective-C member variable permissions
02 ls 命令的具体实现
【webrtc】m98 ninja 构建和编译指令
【罗技】m720
毕业总结
Smart subway | cloud computing injects wisdom into urban subway transportation
Sales management system of lightweight enterprises based on PHP
疫情来袭--远程办公之思考|社区征文