Since a function in C returns only one value, all the time, how can fork(), which is also a function, return two values?
fork()
The fork function returns 0 to the child process that was created and returns the childs ID to the parent process.
The two seperate processes are each returned a single value.
So think of it more as one return being called on each thread process.
2.1m questions
2.1m answers
60 comments
57.0k users