title: What is difference between fork() and ~fork()
body: <p>how ~fork() function call is different then simple fork()..
  i have tried the following code.. in this even child is giving executing the code of parent section.</p>
  
  <pre><code>main()
  {
  pid_t pid = ~fork();
  int a = 2;
  int *ptr = (int*)malloc(sizeof(int));
  *ptr = 2;
  if(pid == 0)
  {
      a = a + 3;
      *ptr = *ptr + 2;
      printf("value at a and ptr in child process : %d and %d\n" , a , *ptr);
      printf("address a and ptr in child process : %p and %p\n" , &amp;a , ptr);
  }
  else
  {
      printf("value at a and ptr in parent process : %d and %d\n" , a , *ptr);
      printf("address a and ptr in parent process : %p and %p\n" , &amp;a , ptr);
  }
  }
  </code></pre>