当前位置:网站首页>14、 C pointer explanation (IV): pointer of pointer
14、 C pointer explanation (IV): pointer of pointer
2022-07-27 23:58:00 【Rock magnon】
List of articles
One 、 The pointer of the pointer
Pointer is used to store the address of the variable , meanwhile , The pointer also has its own address , therefore , You can set a pointer variable , The address used to store the pointer , That's the pointer of the pointer , What he keeps is an address , Pass value character * You can take out the value of the corresponding position
Format :**p
Picture explanation :

Code implementation :
#include<stdio.h> int main(){ int a = 10; int *p1; int **p2; int ***p3; p1 = &a; p2 = &p1; p3 = &p2; printf("a Value :%d\n",a); printf("p1 The value of the address (a The address of ):%p\n",p1); printf("p1 The value of the address store (a Value ):%d\n",*p1); printf("p2 The value of the address (p1 The address of ):%p\n",p2); printf("p2 The value of the address store (p1 Value ,a The address of ):%p\n",*p2); printf("p2 The value of the integer stored in the address (a Value ):%d\n",**p2); printf("p3 The value of the address (p2 The address of ):%p\n",p3); printf("p3 The value of the address store (p2 Value ,p1 The address of ):%p\n",*p3); printf("p3 The value of the integer stored in the address (a Value ):%d\n",***p3); return 0; }Running results :
a Value :10 p1 The value of the address (a The address of ):0x7ffd25ad858c p1 The value of the address store (a Value ):10 p2 The value of the address (p1 The address of ):0x7ffd25ad8590 p2 The value of the address store (p1 Value ,a The address of ):0x7ffd25ad858c p2 The value of the integer stored in the address (a Value ):10 p3 The value of the address (p2 The address of ):0x7ffd25ad8598 p3 The value of the address store (p2 Value ,p1 The address of ):0x7ffd25ad8590 p3 The value of the integer stored in the address (a Value ):10
边栏推荐
- Socket interaction process of four waves
- 为什么 Redis 集群要使用反向代理? 看这篇就明白了
- Notes on Shangpin project in shangsilicon Valley (I)
- The share price soared 180.46%! Shanghai silicon industry, the leader of domestic large silicon wafers, is listed: the cumulative net profit in recent four years is less than 60million
- 数据中台的那些“经验与陷阱”
- 为什么需要等待计时2MSL?
- Flutter pull_ to_ refresh-1.6.0/lib/src/internals/slivers. dart:164:13: Error: Method not found: ‘descr
- urllib.error. URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: un
- BUUCTF-RSA4
- [C language] address book (dynamic version)
猜你喜欢

数据管理的重点

BUUCTF-RSA4

liux常用命令(查看及其开放防火墙端口号+查看及其杀死进程)

【12月海口】2022年第六届船舶,海洋与海事工程国际会议(NAOME 2022)

Realize today's news website based on native JS

传奇服务端:GOM GeeM2引擎更新时必须要修改哪些地方?

TCP的粘包拆包问题+解决方案

Explain the idempotence of distributed system in detail

Decrypt the secret of 90% reduction in oom crash~

Redefine analysis - release of eventbridge real-time event analysis platform
随机推荐
Character stream learning 14.3
QT with OpenGL (shadow mapping)
org.junit.runners.model.InvalidTestClassError: Invalid test class ‘com.zhj.esdemo.MysqlTests‘: 1.
[GWCTF 2019]BabyRSA1
BUUCTF-RSA roll
Redis 哈希Hash底层数据结构
Flutter pull_ to_ refresh-1.6.0/lib/src/internals/slivers. dart:164:13: Error: Method not found: ‘descr
Reduce error demonstration
NDK series (6): let's talk about the way and time to register JNI functions
【开发教程9】疯壳·开源蓝牙心率防水运动手环-心率监测
2022/7/24-7/25
Redis hash underlying data structure
How Flink uses savepoint
[RoarCTF2019]RSA
传奇外网架设教程带图文解说——Gom引擎
2022 summer vacation daily question (5)
(十二)51单片机----用DS18B20浅测一下工(江)西的室外温度
J9 Digital Science Popularization: how does the double consensus of Sui network work?
BUUCTF-bbbbbbrsa
Bank Marketing预测一个客户购买理财产品的成功率