当前位置:网站首页>关于strlen与sizeof的区别
关于strlen与sizeof的区别
2022-06-26 00:13:00 【原来是这样^^】

strlen是用来计算字符串的字符个数,但不包括字符串中最后的结束符'\0'
如图代码第30行所示,显示结果为6,不包含arr[ ]里隐藏的\0
sizeof是用来计算不同类型或变量所占内存的大小,如图第33行计算第28行代码字符数组arr[ ]的大小,所示结果为7字节。
边栏推荐
- Wanglaoji pharmaceutical's public welfare activity of "caring for the most lovely people under the scorching sun" was launched in Hangzhou
- 物联网亿万级通信一站式解决方案EMQ
- Embedded c learning notes
- 22. pixel remapping
- 王老吉药业“关爱烈日下最可爱的人”公益活动在杭启动
- RT thread project engineering construction and configuration - (Env kconfig)
- 程序 编译的步骤 预编译 编译 汇编 连接
- CityJSON
- Common deep learning optimizers
- 判定积分给业务带来价值的两个指标
猜你喜欢

浅谈接口测试(一)

The 19th - 22nd week of scientific research training - about tnet and memnet

GUN make (2) 总述

CYCA少儿形体礼仪 乐清市培训成果考核圆满落幕

Abnova丨CSV 单克隆抗体解决方案

--SQL of urban cultivation manual -- Chapter 1 basic review

Android system startup security

元气少女王钰洁 受邀担任第六季完美童模全球总决赛代言人

Basic concepts of machine learning

GNN (graph neural network) introduction vernacular
随机推荐
"Hot post" Statistics
GUN make (7) 执行make
Dataframe converts the data type of a column
regular expression
What is the process of opening a mobile card account? Is it safe to open an account online?
Redis7.0的安装步骤
Maze walking
Cross validation -- a story that cannot be explained clearly
2021 - 1 - 15 notes de pêche Ctrl + C / V
xargs 的作用详解
cyclegan:unpaired image-to-image translation using cycle-consistent adversarial network
leetcode 300. Longest increasing subsequence (medium)
Talking about interface test (2)
What happens from entering a web address in the browser's input box to seeing the contents of the web page?
Textcnn paper Interpretation -- revolutionary neural networks for sense classification
CyCa children's physical etiquette Yueqing City training results assessment successfully concluded
JSON basic syntax
Is it safe to log in the stock account on the flush? How to open a stock account in the flush
22. pixel remapping
判定积分给业务带来价值的两个指标