当前位置:网站首页>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
边栏推荐
- MySQL 有这一篇就够(呕心狂敲37k字,只为博君一点赞!!!)
- np.argsort()函数详细解析
- Different usage scenarios of subqueries as retrieval tables and the question of whether to add aliases
- Summary of SQL classic interview questions in 2022 (with analysis)
- [Other] DS5
- 猜数字游戏
- navicat连接MySQL报错:1045 - Access denied for user ‘root‘@‘localhost‘ (using password YES)
- C语言(1)
- 函数(c语言)
- union中有struct的情况-从内存分析
猜你喜欢

ClickHouse data insert, update and delete operations SQL

It is enough for MySQL to have this article (37k words, just like Bojun!!!)

navicat新建数据库

PyCharm usage tutorial (more detailed, picture + text)

ClickHouse 数据插入、更新与删除操作 SQL

524.通过删除字母匹配到字典里最长单词

爬虫数据是如何收集和整理的?

Qt在QTableWidget、View等表格中添加右击菜单

C语言指针(指针数组、数组指针、函数指针、传参、回调函数等)超详细

Teach you how to design a CSDN system
随机推荐
卷王的第一篇博客——编程学习的规划
Mysql
C语言:快速排序三种方法(递归)
报错:npm ERR code EPERM
C语言自定义类型一网打尽(结构体、位段/位域、枚举、联合体)
torch.optim.Adam()
人生的第一篇博客(初识代码)
optimizer.zero_grad()
665.非递减数列
Introduction to Oracle Patch System and Opatch Tool
More fragrant open source projects than Ruoyi in 2022
C语言(入门篇一)
argparse —— 命令行选项、参数和子命令解析器
Anaconda安装教程
[Koltin Flow (2)] The end operator of the Flow operator
ClickHouse 数据插入、更新与删除操作 SQL
934.最短的桥(广度优先搜索)
871.最低加油次数(动态规划)
Graphic mirror symmetry (schematic diagram)
爬虫数据是如何收集和整理的?