我们如何指针的多层次可以有? [英] How many levels of pointers can we have?
问题描述
多少个三分球( *
)在一个单一的变量允许的?
让我们看看下面的例子。
int类型的= 10;
为int * p =&放大器;一个;
同样,我们可以有
INT ** Q =&安培; P;
INT *** R =&放大器;问;
等。
例如,
INT **************** ZZ;
的 C
标准规定下限:
5.2.4.1翻译限制
276执行应能够翻译和执行包含以下范围的每一个的至少一个实例的至少一个方案:[...]
279 MDASH; 12指针,数组和函数声明(在任何组合)修改
算术,结构,联合或void类型声明
块引用>的上限是特定的实现。
How many pointers (
*
) are allowed in a single variable?Let's consider the following example.
int a = 10; int *p = &a;
Similarly we can have
int **q = &p; int ***r = &q;
and so on.
For example,
int ****************zz;
解决方案The
C
standard specifies the lower limit: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 pointer, array, and function declarators (in any combinations) modifying an arithmetic, structure, union, or void type in a declaration
The upper limit is implementation specific.
这篇关于我们如何指针的多层次可以有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!