当前位置:网站首页>strlen和sizeof的区别
strlen和sizeof的区别
2022-07-30 05:39:00 【m~~?】
求字符串的长度时
strlen返回的是不包括’\0‘的长度
sizeof返回的是包括’\0‘的长度
int main() {
char a[7] = "hello";
cout << strlen(a) << endl;
cout << sizeof(a) << endl;
}
5
7
边栏推荐
- 每日练习------输出一个整数的二进制数、八进制数、十六进制数。
- 417.太平洋大西洋水流问题
- Solve the problem that the local nacos is not configured but the localhost8848 connection exception always occurs
- optimizer.zero_grad()
- Falling ants (Peking University entrance exam questions)
- EOF的用法——while(scanf(“%d“,&num)!=EOF)
- [Image detection] Research on cumulative weighted edge detection method based on grayscale image with matlab code
- net start mysql MySQL service is starting. MySQL service failed to start.The service did not report any errors.
- The difference between asyncawait and promise
- list(列表)和array(数组)的区别
猜你喜欢

Error: listen EADDRINUSE: address already in use 127.0.0.1:3000

ezTrack-master使用教程

每日练习------输出一个整数的二进制数、八进制数、十六进制数。

SRA数据下载方法总结

MySQL笔记(pymysql)

Anaconda安装教程

EOF的用法——while(scanf(“%d“,&num)!=EOF)

St. Regis Takeaway Project: New dishes and dishes paged query

Detailed MySQL-Explain

Teach you to completely uninstall MySQL
随机推荐
安装pytorch
net start mysql MySQL 服务正在启动 . MySQL 服务无法启动。 服务没有报告任何错误。
Numpy 中 np.vstack() 和 np.hstack() 简单解析
flask-socketio实现的网页聊天室(一)
[详解C语言]一文带你玩转数组
k折交叉验证(k-fold Cross-validation)
ClickHouse data insert, update and delete operations SQL
“tensorflow.keras.preprocessing“ has no attribute “image_dataset_from_directory“
51.N皇后(回溯法)
871.最低加油次数(动态规划)
[Koltin Flow (2)] The end operator of the Flow operator
【Pytorch】torch.manual_seed()、torch.cuda.manual_seed() 解释
C语言人机大战之三字棋博弈
瑞吉外卖项目:新增菜品与菜品分页查询
Teach you to completely uninstall MySQL
mysql time field is set to current time by default
Qt通过QSttings类读取*.ini配置文件
MySQL模糊查询性能优化
Navicat connection MySQL error: 1045 - Access denied for user 'root'@'localhost' (using password YES)
Learn FPGA from the underlying structure (6) ---- Distributed RAM (DRAM, Distributed RAM)