我们如何指针的多层次可以有? [英] How many levels of pointers can we have?

查看:86
本文介绍了我们如何指针的多层次可以有?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

多少个三分球( * )在一个单一的变量允许的?

让我们看看下面的例子。

  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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆