当前位置:网站首页>Double pointer - the role of char **, int **
Double pointer - the role of char **, int **
2022-08-09 11:44:00 【phil__naiping】
The content of this article is very simple, it is to discuss the role of double pointers such as char** and int**.
1, demo
int a = 10;int* b = &a;int** c = &b;
- Pointer b points to variable a; the value of variable a can be manipulated through *b.
- Double pointer c points to pointer b, then *c can manipulate the contents of pointer b.
The crux of the question is what is the content of pointer b?
- The content of pointer b is the address of variable a.Then adding a value to the pointer c is equivalent to adding a value to &a, which is equivalent to moving the pointer to the buffer a.
We might as well think of a as a buffer
Then you can operate on buffer a by adding or subtracting the pointer *c.
2. Summary
Double pointers can be incremented by offsets, moving on the buffer.For example, to write content to the buffer, you can use the double pointer to continuously update the content in the buffer.
边栏推荐
- [Essence] Analysis of the special case of C language structure: structure pointer / basic data type pointer, pointing to other structures
- ACM01 Backpack problem
- enum in c language
- Qt 国际化翻译
- 【面试高频题】可逐步优化的链表高频题
- [现代控制理论]4_PhasePortrait爱情故事动态系统分析
- 学生成绩查找系统
- [现代控制理论]3_Phase_portrait 相图 相轨迹
- How tall is the B+ tree of the MySQL index?
- enum in c language
猜你喜欢
fork creates multiple child processes
【Adobe Premiere Pro 2020】pr2020安装和基本操作【PR安装、新建项目流程、导入及管理素材项目文件、添加标记、创建出入点剪辑视频、快速剪接及自动音乐卡点的方法
[现代控制理论]4_PhasePortrait爱情故事动态系统分析
[现代控制理论]3_Phase_portrait 相图 相轨迹
【Data augmentation in NLP】——1
enum in c language
【精华文】C语言结构体特殊情况分析:结构体指针 / 基本数据类型指针,指向其他结构体
[C language] creation and use of dynamic arrays
x86 Exception Handling and Interrupt Mechanism (3) Interrupt Handling Process
wait system call
随机推荐
[现代控制理论]3_Phase_portrait 相图 相轨迹
_main C:/ti/ccs1011/ccs/tools/compiler/ti-cgt-c2000_20.2.1.LTS/lib/rts2800_fpu32.lib<ar在线升级跳转疑问
[C language] creation and use of dynamic arrays
Chinese valentine's day?Programmers don't exist
x86异常处理与中断机制(2)中断向量表
OC-NSTimer
富媒体在客服IM消息通信中的秒发实践
Two ways to enter the Oracle database
学长告诉我,大厂MySQL都是通过SSH连接的
学生成绩查找系统
x86 Exception Handling and Interrupt Mechanism (3) Interrupt Handling Process
MySQL中的锁
ThreadLocal类
mysql8.0和navicat premium15下载安装
【概率论】正态分布的由来——从大一同学的视角出发
在北京参加UI设计培训到底怎么样?
redis的缓存穿透、缓存雪崩、缓存击穿怎么搞?
es6递归函数
win10 outlook邮件设置
Number theory knowledge