20_pointer_comparison.c 348 B

12345678910111213141516171819202122232425
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int a;
  5. int b;
  6. int *d;
  7. int *e;
  8. d = &a;
  9. e = &b;
  10. a = 12;
  11. b = 34;
  12. printf("%d\n", *d);
  13. printf("%d\n", *e);
  14. printf("%d\n", d == e);
  15. printf("%d\n", d != e);
  16. d = e;
  17. printf("%d\n", d == e);
  18. printf("%d\n", d != e);
  19. return 0;
  20. }
  21. /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/