c++ - 什么是多级指针?

标签 c++ c pointers constants const-cast

阅读关于 const_cast 的内容时我遇到了如下句子:

Only the following conversions can be done with const_cast. In particular, only const_cast may be used to cast away (remove) constness or volatility.

1) Two possibly multilevel pointers to the same type may be converted between each other, regardless of cv-qualifiers at each level.

我已经在谷歌上搜索了一下,但没有找到关于多级指针的任何简明、直接的定义。那么:到底什么是多级指针?

(可能的脸掌时刻)它只是一个指向指针的指针,或指向指向指针的指针的指针,例如int ** 还是 int ***

最佳答案

Is it just a pointer to a pointer, or pointer to a pointer to a pointer, e.g. int ** or int ***?

就是这样,是的。

关于c++ - 什么是多级指针?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22308202/

相关文章:

C 二维数组 : Is the first 'level' an array of pointers?

c - 将文本插入txt文件

c++ - 为什么这是按值调用?

C++使用指针反转字符串

python - Python 3 中是否有类似于 C++ 中的 getchar() 的内置函数?

高效计算数据流的最大值和最小值

c++ - 如何创建指向字节数组的指针?

c++ - 将指向函数的指针分配给指向函数对象的指针的地址

c++ - 使用 Opencv 检测文本上的角点

c++ - 多态和析构函数