Journal_pane_9645661386427751

关于多维数组的指针

这是一段测试多维数组指针的代码,输出结果见图片 #include <iostream> using namespace std; int main() { int a[2][3]={{00,01,02},{10,11,12}}; int (*p)[3]; p=a; cout<<"p="<<p<<endl; cout<<"*p="<<*p<<endl; cout<<"p+1="<<p+1<<endl; cout<<"p+2="<<p+2<<endl; cout<<"*p+1="<<*p+1<<endl; cout<<"*p+2="<<*p+2<<endl; cout<<"*(*p+1)="<<*(*p+1)<<endl; cout<<"**(p+1)="<<**(p+1)<<endl; cout<<"*(p+1)="<<*(p+1)<<endl; cout<<"*(*(p+1)+0)="<<*(*(p+1)+0)<<...

07 December 2013, 02:49 PM
l
love
comment