title: Why the address of variable of child process and parent process is same
body: <p>Here is my code</p>
  
  <pre><code>int main()
  {
    pid_t pid;
    int y = 3;  
    if ( (pid = fork()) &lt;0 )
     return -1;;
  
    if( pid == 0 )  /* child */
    {
      printf(" before: %d %p\n", y, &amp;y );
      y *= 10;
      printf("after: %d %p\n", y, &amp;y );
    }
    else /* father */
    {
     sleep(1);
     printf("father: %d %p\n" , y , &amp;y );
  
    }
    return 0;
  }
  </code></pre>
  
  <p>The output of the program is like following:</p>
  
  <pre><code>before: 3 ffbff440
  after: 30 ffbff440
  father: 3 ffbff440
  </code></pre>
  
  <p>My question is why is address of variable of child and parent same but the value different?</p>