(*ptr)[10]如何 指向一维数组
#include “stdio.h”
void main()
{
int array[10]={1,2,3,4,9};
int (ptr)[10];
int i;
ptr=&array;
for(i=0;i<5;i++)
printf("%d",(*ptr+i));
}
这里有一段英文来详细解释
int *pttrs[10] = an array consists of 10 pointers, any one of which points to integerint
int (*Parrays)[10] = One pointer, which points to an array: int [10]
区别就是第一个 是 10个整型指针 , 第二个是一个 指针,指向一个含有10个整数的数组