fork download
  1. #include<stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int a[4][3] = {1,2,3,4,5,6,7,8,9,10,11,12};
  6.  
  7. int (*p)[3] = a - 1;
  8.  
  9. printf("a[1][0] = %d, *(p[1]+0) = %d \n", a[1][0], *(p[1]+0) );
  10. printf("a[1][2] = %d, *(p[1]+2) = %d \n", a[1][2], *(p[1]+2) );
  11. printf("a[2][1] = %d, *(p[2]+1) = %d \n", a[2][1], *(p[2]+1) );
  12.  
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
a[1][0] = 4, *(p[1]+0) = 1 
a[1][2] = 6, *(p[1]+2) = 3 
a[2][1] = 8, *(p[2]+1) = 5