万能百科  > 所属分类  > 

下列定义中p指向的地址可更改,但 * p不能够更改的是

下列定义中p指向的地址可更改,但 * p不能够更改的是

A.const int * p;

B.int * const p;

C.const int * const p;

D.int * p;

正确答案:

A解析:const int * p;是只能改变指针地址,int * const p;是只能改变 * p的内容,const int * const p;是指针的地址和 * p的内容都不能改变,int * p;是两者都能改变。

词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。

标签