1
0

order.c 523 B

12345678910111213141516171819
  1. /* order.c -- precedence in pointer operations */
  2. #include <stdio.h>
  3. int data[2] = {100, 200};
  4. int moredata[2] = {300, 400};
  5. int main(void)
  6. {
  7. int * p1, * p2, * p3;
  8. p1 = p2 = data;
  9. p3 = moredata;
  10. printf(" *p1 = %d, *p2 = %d, *p3 = %d\n",
  11. *p1 , *p2 , *p3);
  12. printf("*p1++ = %d, *++p2 = %d, (*p3)++ = %d\n",
  13. *p1++ , *++p2 , (*p3)++);
  14. printf(" *p1 = %d, *p2 = %d, *p3 = %d\n",
  15. *p1 , *p2 , *p3);
  16. return 0;
  17. }