fork(2) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. char *foo = "Hello";
  5. char foo2[] = "World";
  6.  
  7. printf("foo %s %p foo2 %s %p \n", foo, foo, foo2, foo2);
  8.  
  9. foo = foo2;
  10. printf("foo %s %p foo2 %s %p \n", foo, foo, foo2, foo2);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
foo Hello 0x8048570 foo2 World 0xbf9daafa 
foo World 0xbf9daafa foo2 World 0xbf9daafa