DO NOT use ideone for unix specific system calls. Granted that it is an
online compiler but it is best to test unix specific system calls on unix
itself..

Ok, so here goes.

A few basics that need to be told before hand..

*fork() system call creates a child process, and returns its process id to
the parent.
The child process is an exact replica of the parent process.
*
So, for example in this snippet of code,

       int color = fork ();

color will have the child process' PID in the parent and 0 in the child.

so here is a line by line analysis of what happens


http://imageshack.us/photo/my-images/202/treeexpl.png/

-- 
Anup Ghatage

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to