单个变量中允许有多少个指针(*)?
How many pointers (*) are allowed in a single variable?
让我们考虑以下示例.
int a = 10;
int *p = &a;
同样我们可以有
int **q = &p;
int ***r = &q;
等等.
例如
int ****************zz;
C标准规定了下限:
276 实现应能够翻译和执行至少一个程序,该程序包含以下每一项限制的至少一个实例:[...]
5.2.4.1 Translation limits
276 The implementation shall be able to translate and execute at least one program that contains at least one instance of every one of the following limits: [...]
279 —12 个指针、数组和函数声明符(任意组合)修改声明中的算术、结构、联合或 void 类型
279 — 12 pointer, array, and function declarators (in any combinations) modifying an arithmetic, structure, union, or void type in a declaration
上限是特定于实现的.
这篇关于我们可以有多少级指针?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
std::reference_wrapper 和简单指针的区别?Difference between std::reference_wrapper and simple pointer?(std::reference_wrapper 和简单指针的区别?)
常量之间的区别.指针和引用?Difference between const. pointer and reference?(常量之间的区别.指针和引用?)
c++ - 如何从指向向量的指针访问向量的内容?How to access the contents of a vector from a pointer to the vector in C++?(c++ - 如何从指向向量的指针访问向量的内容?)
*& 的含义和**&在 C++ 中Meaning of *amp; and **amp; in C++(*amp; 的含义和**amp;在 C++ 中)
为什么我不能对普通变量进行多态?Why can#39;t I do polymorphism with normal variables?(为什么我不能对普通变量进行多态?)
取消引用已删除的指针总是会导致访问冲突?Dereferencing deleted pointers always result in an Access Violation?(取消引用已删除的指针总是会导致访问冲突?)