Using fork, the child process is a clone of the parent. In other words, the two processes are almost identical. The first difference is that as they continue from the returning of fork, the parent gets a non-zero child PID as the return value, whereas the child get 0 as a return value.
man 2 fork explains the differences between the parent and child processes. Particularly,
Furthermore, the parent and child processes do not share any memory space. This means that all global variables and duplicated, along with the stack of the thread that invokes fork.