fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void) {
  5. int a = 78;
  6. int b = 42;
  7. void* a_ptr = &a;
  8. void* b_ptr = &b;
  9.  
  10. a_ptr = a_ptr + (size_t)b_ptr;
  11. b_ptr = a_ptr - (size_t)b_ptr;
  12. a_ptr = a_ptr - (size_t)b_ptr;
  13.  
  14. printf("%d %d\n", a, b);
  15. printf("%d %d\n", *(int*)a_ptr, *(int*)b_ptr);
  16. }
  17.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
78 42
42 78