19_pointer_arithmetic.c 368 B

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