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);

}

Source code

Hint 1: The program outputs more than just "Hello World".

Next Hint
Answer

Main gallery