zippo2.c 650 B

12345678910111213141516171819202122
  1. /* zippo2.c -- zippo info via a pointer variable */
  2. #include <stdio.h>
  3. int main(void)
  4. {
  5. int zippo[4][2] = { {2,4}, {6,8}, {1,3}, {5, 7} };
  6. int (*pz)[2];
  7. pz = zippo;
  8. printf(" pz = %p, pz + 1 = %p\n",
  9. pz, pz + 1);
  10. printf("pz[0] = %p, pz[0] + 1 = %p\n",
  11. pz[0], pz[0] + 1);
  12. printf(" *pz = %p, *pz + 1 = %p\n",
  13. *pz, *pz + 1);
  14. printf("pz[0][0] = %d\n", pz[0][0]);
  15. printf(" *pz[0] = %d\n", *pz[0]);
  16. printf(" **pz = %d\n", **pz);
  17. printf(" pz[2][1] = %d\n", pz[2][1]);
  18. printf("*(*(pz+2) + 1) = %d\n", *(*(pz+2) + 1));
  19. return 0;
  20. }