当前位置:网站首页>(指針)自己寫一個比較字符串大小的函數,功能與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;
}
边栏推荐
- [paddleseg source code reading] paddleseg calculates Miou
- My opinion on how to effectively telecommute | community essay solicitation
- 拼夕夕二面:说说布隆过滤器与布谷鸟过滤器?应用场景?我懵了。。
- Flink学习7:应用程序结构
- Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
- CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
- 【华为云IoT】读书笔记之《万物互联:物联网核心技术与安全》第3章(上)
- vue多级路由嵌套怎么动态缓存组件
- Common methods of threads
- 【微服务|openfeign】使用openfeign远程调用文件上传接口
猜你喜欢

Flink学习6:编程模型

Getting started with the go language is simple: go implements the Caesar password

干货!基于GAN的稀有样本生成

1289_ Implementation analysis of vtask suspend() interface in FreeRTOS

Evolution of MySQL database architecture

leetcode刷题:二叉树06(对称二叉树)

ctf-pikachu-XSS

用于TCP协议交互的TCPClientDemo

Two commonly used graphics can easily realize data display

Distributed system: what, why, how
随机推荐
I was tortured by my colleague's null pointer for a long time, and finally learned how to deal with null pointer
Lnk2038 detected a mismatch of "runtimelibrary": the value "md_dynamicrelease" does not match the value "mdd_dynamicdebug" (in main.obj)
智慧地铁| 云计算为城市地铁交通注入智慧
Two commonly used graphics can easily realize data display
Flink学习8:数据的一致性
leetcode刷题:二叉树05(翻转二叉树)
Pointer array and array pointer
Small record of thinking
Graduation summary
Flink learning 7: application structure
How to telecommute more efficiently | community essay solicitation
TCP-三次握手和四次挥手简单理解
STM32 external DHT11 display temperature and humidity
程序员远程办公喜忧参半| 社区征文
How to dynamically cache components in Vue multi-level route nesting
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
'2'&gt;' 10'==true? How does JS perform implicit type conversion?
Smart subway | cloud computing injects wisdom into urban subway transportation
Flink learning 6: programming model
分布式系统:what、why、how