分类: C/C++
2008-11-27 19:40:34
程序运行结果如下:
&a[0][0]=0x0012FF50 &a[0][1]=0x0012FF54 &a[0][2]=0x0012FF58
&a[1][0]=0x0012FF
&a[2][0]=0x0012FF68 &a[2][1]=0x0012FF
&a[3][0]=0x0012FF74 &a[3][1]=0x0012FF78 &a[3][2]=0x0012FF
a[0]=0x0012FF50
a[1]=0x0012FF
a[2]=0x0012FF68
a[3]=0x0012FF74
a+0=0x0012FF50
a+1=0x0012FF
a+2=0x0012FF68
a+3=0x0012FF74
*(a+0)=0x0012FF50
*(a+1)=0x0012FF
*(a+2)=0x0012FF68
*(a+3)=0x0012FF74
**(a+0)=11
**(a+1)=21
**(a+2)=31
**(a+3)=41
*(*(a+0)+0)=11 *(*(a+0)+1)=12 *(*(a+0)+2)=13
*(*(a+1)+0)=21 *(*(a+1)+1)=22 *(*(a+1)+2)=23
*(*(a+2)+0)=31 *(*(a+2)+1)=32 *(*(a+2)+2)=33
*(*(a+3)+0)=41 *(*(a+3)+1)=42 *(*(a+3)+2)=43
(*(a+0)+0)=0x0012FF50 (*(a+0)+1)=0x0012FF54 (*(a+0)+2)=0x0012FF58
(*(a+1)+0)=0x0012FF
(*(a+2)+0)=0x0012FF68 (*(a+2)+1)=0x0012FF
(*(a+3)+0)=0x0012FF74 (*(a+3)+1)=0x0012FF78 (*(a+3)+2)=0x0012FF
*(a+0+0)=0x0012FF50 *(a+0+1)=0x0012FF
*(a+1+0)=0x0012FF
*(a+2+0)=0x0012FF68 *(a+2+1)=0x0012FF74 *(a+2+2)=0x0012FF80
*(a+3+0)=0x0012FF74 *(a+3+1)=0x0012FF80 *(a+3+2)=0x0012FF
Press any key to continue
程序如下:
#include
void main(){
int a[4][3]={11,12,13,21,22,23,31,32,33,41,42,43};
int i,j;
for (i=0; i<4; i++,cout<
for (j=0;j<3;j++)
cout<<"&a["<
for (cout<
cout<<"a["<
for (cout<
cout<<"a+"<
for (cout<
cout<<"*(a+"<
for (cout<
cout<<"**(a+"<
for (i=0;cout<
for (j=0;j<3;j++)
cout<<"*(*(a+"<
for (i=0; cout<
for (j=0;j<3;j++)
cout<<"(*(a+"<
for (i=0; cout<
for (j=0;j<3;j++)
cout<<"*(a+"<
}