Forking

Learn about the functionality of fork( ) in this lesson.

We'll cover the following

We have already learned, in the last lesson, that a running program is known as a process, and we can create another process from this running program. The first one is known as the parent process; whereas, the second one is known as the child process.

fork()

fork() launches a child process. Control goes to fork() only once. Whereas, control returns from fork() twice.

Example program

See the code given below:

Get hands-on with 1400+ tech skills courses.