当前位置:网站首页>Fundamentals of C language -- 2-6 pointers, arrays and sizeof operators
Fundamentals of C language -- 2-6 pointers, arrays and sizeof operators
2022-07-23 16:59:00 【Bazinga bingo】
sizeof yes C A language operator ( The main sizeof It's not a function , Although the usage is much like a function ),sizeof The function of is to return () The number of memory bytes occupied by the variables or data types inside .
strlen It's a C Library function , Used to return the length of a string ( notes , The length of the string is not calculated at the end of the string ‘/0’ Of ),strlen The received parameter must be a string .
char str[] = "hello"; sizeof(str)=6 sizeof(str[0])=1 strlen(str)=5
char str[] = "hello"; char *p=str; sizeof(p)=4 sizeof(*p)=1 strlen(p)=5
int n=10; sizeof(int)=4 sizeof(n)=4
int b[100]; sizeof(b)=400 // 100*sizeof(int)
void func(int *a) {
sizeof(a); } int main(void) {
int b[100]; } sizeof(a)=4 // The function passes in the address , Not the whole array
#define dpChar chae * typedef char * tpChar —— Rename type
dpChar *p1,p2; // an :char *p1,p2; char *p1; char p2;
tpChar *p1,p2; // Equivalent :char *p1; char *p2;
边栏推荐
- Using "soup.h1.text" crawler to extract the title will be one more\
- 微信小程序class绑定,怎么绑定2个变量
- Heartless sword English Chinese bilingual poem 006. to my wife
- 考过PMP对实际工作帮助大吗?
- 软件体系结构
- 软件测试计划包括哪些内容,测试计划如何编写。分享测试计划模板
- Cuibaoqiu, vice president of Xiaomi group: open source is the best platform and model for human technological progress
- Scale Match for Tiny Person Detection
- 浏览器四大内核
- 卷积神经网络模型之——GoogLeNet网络结构与代码实现
猜你喜欢

Royal O'Brien, executive director of o3df: open source has no boundaries, and all shared sounds will become the actual direction

微机原理与技术接口随堂练习

【Web漏洞探索】SQL注入漏洞

VMware虚拟机的三种网络模式

通用分页功能

灰色关联分析(MATLAB)
![[C language] structure, enumeration and union](/img/18/3d9c511950cbcbd109df3104fbe248.png)
[C language] structure, enumeration and union

Acquisition of positional reliability in accurate target detection

Compose Canvas饼图效果绘制

TOPSIS法(MATLAB)
随机推荐
Squeeze and incentive networks
securecrt 乱码
灰色预测(MATLAB)
Priyanka Sharma, general manager of CNCF Foundation: read CNCF operation mechanism
Visual analysis of real-time epidemic data
Is it safe for online account managers to open accounts when choosing securities companies in flush
sprintf和cv::putText
主成分分析(MATLAB)
微机原理与技术接口笔记
MATLAB基础
三方支付公司有哪些?
层次分析法(MATLAB)
COPU副主席刘澎:中国开源在局部领域已接近或达到世界先进水平
Advanced authentication of uni app [Day12]
Closure of JS
阿里平头哥CPU技术生态负责人陈炜:平头哥的发展之路
YOLOV7
tensorflow2.X实战系列softmax函数
零基础怎么自学软件测试?十年测试老鸟最强软件测试学习路线图
AutoCAD进阶操作