当前位置:网站首页>(pointer) write a function to compare the size of strings by yourself, which is similar to StrCmp.
(pointer) write a function to compare the size of strings by yourself, which is similar to StrCmp.
2022-07-04 04:20:00 【I'm not Xiao Haiwa~~~~】
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;
}
边栏推荐
- Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure
- 10 reasons for not choosing to use free virtual hosts
- Distributed system: what, why, how
- '2'&gt;' 10'==true? How does JS perform implicit type conversion?
- 2022-07-03: there are 0 and 1 in the array. Be sure to flip an interval. Flip: 0 becomes 1, 1 becomes 0. What is the maximum number of 1 after turning? From little red book. 3.13 written examination.
- Select sorting and bubble sorting template
- 支持首次触发的 Go Ticker
- "Implement both software and hardware" to help build a new cloud computing data center
- 如何远程办公更有效率 | 社区征文
- leetcode刷题:二叉树08(N叉树的最大深度)
猜你喜欢
1289_ Implementation analysis of vtask suspend() interface in FreeRTOS
ctf-pikachu-CSRF
[csrf-01] basic principle and attack and defense of Cross Site Request Forgery vulnerability
PPt 教程,如何在 PowerPoint 中将演示文稿另存为 PDF 文件?
Msgraphmailbag - search only driveitems of file types
I was tortured by my colleague's null pointer for a long time, and finally learned how to deal with null pointer
User defined path and file name of Baidu editor in laravel admin
My opinion on how to effectively telecommute | community essay solicitation
PostgreSQL users cannot create table configurations by themselves
量子力学习题
随机推荐
【webrtc】m98 ninja 构建和编译指令
TCP-三次握手和四次挥手简单理解
STM32外接DHT11显示温湿度
leetcode刷题:二叉树07(二叉树的最大深度)
Spa in SDP
LNK2038 检测到“RuntimeLibrary”的不匹配项: 值“MD_DynamicRelease”不匹配值“MDd_DynamicDebug”(main.obj 中)
Simple dialogue system -- text classification using transformer
(指针)编写函数void fun(int x,int *pp,int *n)
Flink learning 7: application structure
Confession code collection, who says program apes don't understand romance
支持首次触发的 Go Ticker
How to telecommute more efficiently | community essay solicitation
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
Redis cluster view the slots of each node
[Huawei cloud IOT] reading notes, "Internet of things: core technology and security of the Internet of things", Chapter 3 (I)
Storage of MySQL database
【读书会第十三期】多媒体处理工具 FFmpeg 工具集
The new data center helps speed up the construction of a digital economy with data as a key element
Programmers' telecommuting is mixed | community essay solicitation
How was my life in 2021