changing vfork with fork gives the correct output but in case of vfork the loop behaviour is unpredictable
@harit : I guess the child is simply reading the value of i from the same data area of the parent. First time it showed a garbage, after which it shows the value inputted in the parent. If i am not wrong the child uses text and data area of parent till a exec is not been called in the child. Here in the program parent and child are not doing any tweak with the text area then how can we explain the loop behaviour of the program. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.