当前位置:网站首页>Pointer of C language (3)
Pointer of C language (3)
2022-07-22 09:19:00 【fksfdh】
3、 ... and 、 Array pointers and two-dimensional arrays
int main()
{
// Array pointer
int(*p)[4];
int a[3][4] = {
1,2,3,4,5,6,7,8,9,10,11,12};
p = a;
printf("sizeof(p)=%d\n",sizeof(p) );
printf("sizeof(a)=%d\n", sizeof(a));
//*(p+1) amount to p[1]
printf("*(p + 1)[1] = %d\n", *(p+1)[1]); // amount to *(p+1+1) and p[2]
//printf("&a + 1 = %x",&a + 1); &a Represents the entire array
// Take out the numbers 6
printf("a[1][1] = %d\n", a[1][1]);
printf("p[1][1] = %d\n", p[1][1]);
printf("*(*(p+1)+1) = %d\n", *(*(p+1)+1));
printf("*(p[1]+1) = %d\n", *(p[1]+1));
printf("*(&a[1][1]) = %d\n", *(&(a[1][1])));
return 0;
}
边栏推荐
猜你喜欢
1989-2020年学历结构和计算平均受教育年限数据
创建线程的方式
移除iPhone手机删不掉的绿色logo的百宝箱App
js执行机制
"Everything is interconnected, enabling thousands of industries", the 2022 open atom global open source summit openatom openharmony sub forum is about to open
Analysis of copyonwritearraylist
LeetCode342:4的幂
leetCode-12: 整数转罗马数字
腾讯游戏 :我们如何基于 StarRocks 构建云原生数仓
Ctrip spark multi tenant query service evolution, Apache Kyuubi can be expected in the future
随机推荐
flex布局
Vscode configures markdown and the basic syntax of markdown
go Redis 管道(pipeline)运用
调整数组顺序使奇数位于偶数前面
CAN通信协议(一)
单细胞论文记录(part18)--Spectral clustering based on learning similarity matrix
Literature learning (part98) -- pseudosupervised deep subspace clustering
类加载器简介
OpenGL:freeglut ERROR: Function <glutCreateWindow> called without first calling ‘glutInit‘.
飞机大战分析及代码
两个栈实现一个队列
创建新节点的点击事件
无法打开“xxx”,因为无法确认开发者的身份。 或者说什么文件已损坏解决方法
Tool classes encapsulated based on redistemplate
Go zero micro service practical series (III. API definition and table structure design)
Chrome插件开发教程
Tencent cloud free upgrade.
"Everything is interconnected, enabling thousands of industries", the 2022 open atom global open source summit openatom openharmony sub forum is about to open
EasyCVR平台安全扫描提示Go pprof调试信息泄露的解决办法
Collection集合框架