当前位置:网站首页>Count the number of arrays with pointers
Count the number of arrays with pointers
2022-06-28 23:08:00 【51CTO】
Using the array address subtraction to calculate the number of elements of the array
int
my_strlen(
char
*
str)
{
char
*
star
=
str;
char
*
end
=
str;
while (
*
end
!=
'\0')
{
end
++;
}
return
end
-
star;
}
int
main()
{
char
arr[]
=
"bit";
int
len
=
my_strlen(
arr);
printf(
"%d\n",
len);
return
0;
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
边栏推荐
- How to solve the problem of desktop without sound
- Junior, it's not easy!
- Small sample sharp weapon 2 Text confrontation + semi supervised FGSM & VAT & FGM code implementation
- How to analyze the trend chart of London gold market with the moving average
- LeetCode 324 摆动排序 II[排序 双指针] HERODING的LeetCode之路
- 【Try to Hack】nmap
- 数学知识:求组合数 I—求组合数
- 浅析搭建校园在线教学视频汇聚平台的必要性及解决方案
- Qtcreater5.15.0 source code compilation process record
- [chapter 71 of the flutter problem series] mutual conversion between uint8list and image in flutter
猜你喜欢

A password error occurred when docker downloaded the MySQL image to create a database link
![LeetCode 324 擺動排序 II[排序 雙指針] HERODING的LeetCode之路](/img/41/b8ba8d771b7224eac1cc8c54fe9d29.png)
LeetCode 324 擺動排序 II[排序 雙指針] HERODING的LeetCode之路

如何使用伦敦金画出支撑阻力线

Basic knowledge diagram of K-line Diagram -- meaning of single K-line

第三章 处理机调度练习

C interview questions_ 20220627 record

笔记

Progress of dbnn experiment

Encounter with avita 11: long lost freshness under strong product power

Hit the industry directly | the flying propeller launched the industry's first model selection tool
随机推荐
没找到实习,他总结了这些
Sample code of using redis to realize the like function
C interview questions_ 20220627 record
Is it safe to open a stock account online?
How to solve the problem of desktop without sound
WEB API学习笔记1
第二章 经典同步练习作业
Is it safe to open a stock account by mobile phone?
Realization of 2D code generation in micro build low code
见丰知夏|国漫鼻祖丰子恺,数字藏品独家发售
Linq连表查询
Online text filter less than specified length tool
Zadig + sonarqube, ensuring the safety of the development process
C语言-单词分析解析
See fengzhixia | FENGZikai, the originator of Guoman, for exclusive sale of Digital Collections
一文读懂,WMS仓储管理系统与ERP有什么区别
SqlServer复习
Didn't find an internship. He summed it up
TDD and automated testing
【Flutter 問題系列第 71 篇】Flutter 中 Uint8List 和 Image 之間的相互轉換