编译后输出:
0xbfbb8eb4
0xbfbb8eb4
1
3
#include<iostream>
using namespace std;
void f(int(*p)[3]){
cout<<p[0]<<endl;
cout<<p[2]<<endl;
}
int main(){
int a1[3]={1,2,3};
cout<<a1<<endl;
cout<<&a1<<endl;
f(&a1);
}
编译后输出:
0xbff21e84
0xbff21e84
0xbff21e84
0xbff21e9c
由此比较可以看出,
void f(int(*p)[3]){}是个函数指针数组,指针数组属于二级指针
void f(int(&p)[3]){} 和void f(int(*p)[3]){}的区别,布布扣,bubuko.com
void f(int(&p)[3]){} 和void f(int(*p)[3]){}的区别
原文:http://blog.csdn.net/shudaqi2010/article/details/24858813