指针的指针数组 [英] Pointer to Array of Pointers

查看:146
本文介绍了指针的指针数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是int指针为int * ARR [MAX]数组; ,我想它的地址存储在另一个变量。如何定义一个指针,指针数组?即:

 为int * ARR [MAX];
INT(这里是什么?)VAL =安培;编曲;


解决方案

应该仅仅是:

 为int *阵列[SIZE]
INT ** VAL =阵列;

有没有必要在阵列使用地址的运营商因为数组衰变为赋值运算符的右侧。

隐指针

I have an array of int pointers int* arr[MAX]; and I want to store its address in another variable. How do I define a pointer to an array of pointers? i.e.:

int* arr[MAX];
int (what here?) val = &arr;

解决方案

Should just be:

int* array[SIZE];
int** val = array;  

There's no need to use an address-of operator on array since arrays decay into implicit pointers on the right-hand side of the assignment operator.

这篇关于指针的指针数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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