当前位置:网站首页>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;
边栏推荐
- RISC-V基金会董事谭章熹:RISC-V,从边缘逐渐向中央扩展
- Case analysis of building campus information management system with low code
- 【TensorFlow】检测TensorFlow GPU是否可用
- [note] linear regression
- 微机原理与技术接口笔记
- Tips and tricks for Neural Networks 深度学习训练神经网络的技巧总结(不定期更新)
- 网络协议与攻击模拟:wireshark使用、ARP协议
- Cuibaoqiu, vice president of Xiaomi group: open source is the best platform and model for human technological progress
- Tan Zhangxi, director of risc-v Foundation: risc-v has gradually expanded from the edge to the center
- 48:第五章:开发admin管理服务:1:创建子工程【imooc-news-dev-service-admin】,管理服务模块;
猜你喜欢

Direct exchange

灰色关联分析(MATLAB)

Pinduoduo app product details interface to obtain activity_ ID value (pinduoduo activity_id interface)

智慧物联网源码 带组态物联网源码 工业物联网源码:支持传感器解析服务,数据实时采集和远程控制

零基础怎么自学软件测试?十年测试老鸟最强软件测试学习路线图

FIO performance testing tool

通用分页功能

AutoCAD进阶操作

Acquisition of positional reliability in accurate target detection

Squeeze and incentive networks
随机推荐
Lake Shore - empx-h2 low temperature probe station
O3DF执行董事Royal O’Brien:开源没有边界,所有共享的声音都会变成实际方向
一文带你了解什么是TypeScript
Object.defineProperty方法、数据代理
Microcomputer principle and technical interface practice in class
Satisfiability of the equation of leetcode
[untitled]
怎么正确设置路由器
Tan Zhangxi, director of risc-v Foundation: risc-v has gradually expanded from the edge to the center
Detector: detect objects with recursive feature pyramid and switchable atolos convolution
Direct exchange
Pinia (pineapple)
Priyanka Sharma, general manager of CNCF Foundation: read CNCF operation mechanism
微机原理与技术接口随堂练习
pairwise的使用
How does MySQL query data that is not in the database?
浏览器同源策略
YOLOV7
RISC-V基金会董事谭章熹:RISC-V,从边缘逐渐向中央扩展
UiPath Studio Enterprise 22.4 Crack