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