const int **pp = &p;
来源:互联网 发布:淘宝达人机构申请 编辑:程序博客网 时间:2024/05/07 18:09
const int v;
const int *p = &v;
const int **pp = &p;
即*p的类型为const int*,**p的类型为const int
其实识别这种语法很简单,注意看const的位置,如果在*左边,则表示最终指向的数据为只读,多级指针亦如此。
如果*在变量名的左边,例:int **const pp;,表示pp自身为只读。
第三种情况,const不仅在*左边还在变量名左边,则表示最终指向的数据和自身都为只读,例:const int **const pp;
const int *p = &v;
const int **pp = &p;
即*p的类型为const int*,**p的类型为const int
其实识别这种语法很简单,注意看const的位置,如果在*左边,则表示最终指向的数据为只读,多级指针亦如此。
如果*在变量名的左边,例:int **const pp;,表示pp自身为只读。
第三种情况,const不仅在*左边还在变量名左边,则表示最终指向的数据和自身都为只读,例:const int **const pp;
0 0
- const int **pp = &p;
- const int *p,const * int p,int const *p
- const int * p,int const * p,int * const p
- 详解const int *p,int*const p,int const *p
- 详解const int *p,int*const p,int const *p
- const int *p,const * int p,int const *p
- const int *p,const * int p,int const *p
- const int *p,const * int p,int const *p
- const int *p,const * int p,int const *p
- const int *p,const * int p,int const *p
- const int *p、int * const p、int const *p
- const int *p,const * int p,int const *p
- const int *p,const * int p,int const *p
- const int *p,const * int p,int const *p
- const int *p,const * int p,int const *p
- const int *P 、int const *p 、int *const P 详解
- const int* p和int* const p
- const int *p,int *const p区别
- HTML5:组织内容
- CNN卷积神经网络的改进(15年最新paper)
- opencv图像处理基本操作
- java请求第三方接口
- 整合 spring 4(包括mvc、context、orm) + mybatis 3 示例
- const int **pp = &p;
- 浏览器渲染过程
- VirtualBox
- clickonce 程序手工清除方法
- Command /bin/sh filed with exit code 126
- Java简单算法——分解质因数
- python-mysqldb的几个函数(一)
- 韩信点兵
- JVM学习篇(4)之线程安全与锁优化