当前位置:网站首页>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.
边栏推荐
- fork creates multiple child processes
- The use of gdb tui
- fidder为什么不会抓包的问题
- mysql + redis + flask + flask-sqlalchemy + flask-session 配置及项目打包移植部署
- 推荐一个免费50时长的AI算力平台
- ClickHouse物化视图(八)
- TIC2000调用API函数Flash擦除片上FLASH失败
- The use of signal function (signal) in C language
- 【VQA survey】视觉问答中的语言学问题
- Fapi_StatusType Fapi_issueProgrammingCommand使用注意事项
猜你喜欢
随机推荐
修改VOT2018.json文件,去掉图片路径中的color
LeetCode_单调栈_中等_456.132 模式
ICML 2022 | Out-of-Distribution Detection with Deep Nearest Neighbors
使用.NET简单实现一个Redis的高性能克隆版(四、五)
【VQA survey】视觉问答中的语言学问题
End-to-End Object Detection with Fully Convolutional Network学习笔记
wpf path xaml写法和c#写法对比
[现代控制理论]5_系统的可控性_controllability
fork创建多个子进程
Django 无法链接mysql数据库
使用gdb调试多进程程序、同时调试父进程和子进程
PAT1011
x86 Exception Handling and Interrupt Mechanism (1) Overview of the source and handling of interrupts
[现代控制理论]2_state-space状态空间方程
UNIX Philosophy
PAT1006
Redis高可用部署
ZOJ1298(单源最短路径)
实验记录:搭建网络过程
PTA 实验7-5 输出大写英文字母(10 分)