// procMem1.c++ memory of child process #include using namespace std; #include #include #include #include int main() { // procMem1.c++ int chPID, n ; chPID = fork(); if(chPID == -1) { // fork fails cerr << "fork() fails\n"; return 0; } if(chPID > 0){ // parent n=10; cout << "In parent &n:" << (void *)&n << ", n: " << n << endl; } else { // child n=15; cout << "In child &n:" << (void *)&n << ", n: " << n << endl; } return 0 ; }