Check out example codes for "fork was not declared in this scope". It will help you in understanding the concepts better.

Code Example 1

#include <unistd.h>

Learn ReactJs, React Native from akashmittal.com