Home > Back-end >  Using pointer reference two-dimensional array
Using pointer reference two-dimensional array

Time:10-27

#include
Int main ()
{
Int a [3] [4]=,2,3,4,5,6,7,8,9,0,11,21 {1};
int i,j;
Int * (p) [4];
P=a;
for(i=0; i<3; I++)
{
for(j=0; J<4. J++)
Printf (" % d ", * (* (p + I) + j));
printf("\n");
}
}
O check,,,

CodePudding user response:

 
Int main ()
{
Int a [3] [4]=,2,3,4,5,6,7,8,9,10,11,12 {1};
Int * p=a, [0].

for(int i=0; i<3; I++)
{
For (int j=0; J<4. J++)
Printf (" % d ", * (p + 4 * I + j));
printf("\n");
}

system("pause");
}

CodePudding user response:

Should be defined as
Int (* p) [4];
  • Related