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");
}
}

VulpesPosted Sep 29, 2013, 9:40 AM
As expected the output is:
1 2
3 4
Ken HPosted Sep 29, 2013, 9:22 PM
Jaganathan BantheswaranPosted Sep 29, 2013, 5:38 AM
Try to assign like this.