fork download
  1. #include <stdio.h>
  2. #include <memory.h>
  3.  
  4. int main(void)
  5. {
  6. char s1[128];
  7. int _1[128];
  8. char *s2 = malloc(128);
  9. int _2[128];
  10.  
  11. printf("s1: %p %p\ns2: %p %p\n", s1, &s1, s2, &s2);
  12.  
  13. scanf("%s %s", &s1, &s2);
  14.  
  15. printf("s1: %p %p\ns2: %p %p\n", s1, &s1, s2, &s2);
  16.  
  17. printf("&s1: <<<%s>>>\n", &s1), fflush(stdout);
  18. printf("s1: <<<%s>>>\n", s1), fflush(stdout);
  19.  
  20. printf("&s2: <<<%s>>>\n", &s2), fflush(stdout);
  21. printf("s2: <<<%s>>>\n", s2), fflush(stdout);
  22.  
  23. return 0;
  24. }
Runtime error #stdin #stdout 0s 4216KB
stdin
abc
def
stdout
s1: 0x7ffe2084acc0 0x7ffe2084acc0
s2: 0x55e2357a2260 0x7ffe2084acb8
s1: 0x7ffe2084acc0 0x7ffe2084acc0
s2: 0x55e200666564 0x7ffe2084acb8
&s1: <<<abc>>>
s1:  <<<abc>>>
&s2: <<<def>>>