c++笔记,指针的定义
2017-08-01 13:56
106 查看
牛客网上看见别人整理的,恍然大悟~~~
把*读作"pointer to",从右至左念:
b是一个常量
const int b; /* b is a int const */
int const b; /* b is a const int */
p是一个普通指针,指向一个常量
const int *p; /* p is a pointer to int const */
int const *p; /* p is a pointer to const int */
p是一个常量指针,指向一个普通变量
int *const p; /* p is a const pointer to int */
p是一个常量指针,指向一个常量
const int *const p; /* p is a const pointer to int const */
int const *const p; /* p is a const pointer to const int */
把*读作"pointer to",从右至左念:
b是一个常量
const int b; /* b is a int const */
int const b; /* b is a const int */
p是一个普通指针,指向一个常量
const int *p; /* p is a pointer to int const */
int const *p; /* p is a pointer to const int */
p是一个常量指针,指向一个普通变量
int *const p; /* p is a const pointer to int */
p是一个常量指针,指向一个常量
const int *const p; /* p is a const pointer to int const */
int const *const p; /* p is a const pointer to const int */
相关文章推荐
- c++ primer 学习笔记21类的定义和声明、隐含的this指针、类作用域
- 黑马程序员—C学习笔记—结构体变量五种定义方式与指针结构体数组探究
- [C++学习笔记14]动态创建对象(定义静态方法实现在map查找具体类名对应的创建函数,并返回函数指针,map真是一个万能类)good
- 【C++学习笔记】12_指针的定义与使用
- effective C++笔记之条款31、32: 千万不要返回局部对象的引用,也不要返回函数内部用new初始化的指针所指对象的引用、尽可能地推迟变量的定义
- C++ Primer 学习笔记:指针定义声明
- c语言复习笔记--指针定义
- C/C++_log2000_函数声明与指针定义等零散知识点随手笔记
- 听翁恺老师mooc笔记(3)--指针的定义
- C和指针笔记(六)
- C和指针笔记(七)
- 【Matlab学习笔记】(六)基本数据结构(矩阵定义方法)
- .net / vb2008指针的定义
- 利用typedef定义函数指针
- C/C++学习笔记17:函数指针
- php——学习笔记,预定义变量
- Python笔记——类定义
- C语言学习笔记----伊能C语言学习笔记----如何在一个文件中使用另一个文件中定义的变量呢??
- 13\给定单向链表的头指针和一个结点指针,定义一个函数在O(1)时间删除该结点,
- 二维数组指针的定义和初始化