in reply to fork : distinguish between different child?

I am wondering if there's a way that I can distinguish between different childs; is there a child number, like first child, second child etc?
You mean, does the OS assign each process a unique number? It certainly does, the process ID. It's the return value of fork (in the parent).

But you already knew that, judging from your code.

Replies are listed 'Best First'.
Re^2: fork : distinguish between different child?
by ikegami (Patriarch) on Oct 25, 2011 at 04:45 UTC
    How does that help him get the right array element?