数组指针与指针数组的区别,不明白,我打的代码不知道哪里出错
int _tmain(int argc, _TCHAR* argv[]){
char *p1[4]={"iphone" , "ios" , "wp" , "id"};
int i = 0 , *p2[3] , a[3] = { 1 , 2 ,3 },b[3][2] = { 1 ,2 , 3 ,4 , 5 , 6 };
for (int i = 0;i < 4 ; i++)
{
printf( "\n %s ", p1[i] );
printf( "\n" );
}
for (int i = 0 ; i < 3 ; i++ )
{
p2[i] = &a[i];
for ( int i = 0 ; i < 3 ; i++ )
{
printf( "%d ",p2[i] );
printf( "\n" );
}
}
for (int i = 0 ; i < 3 ;i++ )
{
p2[i] = b[i];
for ( int i = 0 ; i < 3 ; i++ )
{
printf( "%s %d\n", *p1[i+1] , *p2[i] );
}
}
getchar();
return 0;