When I try to indirect reference error occurred while two-dimensional array.
My codes are here:
#include
void main(void)
{
int arrTwo[2][2]={{1,2},{3,4}},*pointer_one,**pointer_two;
pointer_one=arrTwo;
pointer_two=pointer_one; // Try an indirect reference to two-dimensional array.
for (int i=0;i<2;i++)
{
for (int j=0;j<2;j++)
printf("%d ",*([pointer_two+i]+j));
printf("\n");
}
}


VulpesRank #55 · 29.2K reputationPosted Sep 29, 2013, 5:40 AM EDT
As expected the output is:
1 2
3 4
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Sep 29, 2013, 1:38 AM EDT
Try to assign like this.
Ken HRank #2,315 · 610 reputationPosted Sep 29, 2013, 5:22 PM EDT