I have this program in C++ that forks two new processes:
#include
#include
#include
#include
yes what you have thought is right but in order to save some memory, internally the pages are shared between the parent and the child till the child executes exec system call or modifies any of the variables or the data structures.since many pages are shared between parent and child.....if the page is modified by child,then that page will copied into separate memory area and will be assigned to the child.if it is modified by parent,then that page will be copied to separate memory area and assigned to the parent