fork(1) download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void) {
  5.  
  6. int b = 20;
  7.  
  8. char string[20];
  9.  
  10. memset(string, 0, 20);
  11.  
  12. sprintf(string, "%p\n", &b);
  13.  
  14. printf("address of variable string: %p\n", string);
  15. printf("address of variable b: %s\n", string);
  16.  
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
address of variable string: 0x7ffd604d6950
address of variable b: 0x7ffd604d694c