An expert programmer decided to use multiple processes to do a simple job. (For the purposes of this problem, we'll ignore the sanity aspects of this design.)
The program executes, but the programmer gets more than he expects.
#include <iostream>
#include <unistd.h>
int main()
{
std::cout << "Hello ";
if (fork() == 0) {
std::cout << "World\n";
}
return (0);
}
Hint 1: The program outputs more than just "Hello World".
Hint 2:
A fork make an exact duplicate of the program.
Hint 3:
A fork make an exact duplicate of the program including
the program's memory.