fork download
  1. #include <stdio.h>
  2.  
  3. #define PUT_ADDR(p, val) (*(void **)(p) = (void *) (val))
  4. #define GET_ADDR(bp) (*(void **) (bp))
  5.  
  6. int main(void) {
  7. int a = 3;
  8. void *p = &a;
  9. void *q;
  10. PUT_ADDR(q, p);
  11. printf("%d", * (int *) GET_ADDR(q));
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
3