Table Of Contents
Previous Section Next Section

Chapter 8: Expert Confusion

Welcome to one of the toughest parts of the book. The few programs in this section are designed to baffle even the most expert C or C++ programmer. You may think you know all about programming, but the problems presented next are the toughest, most difficult ones around.

There are only three problems in this chapter. If you get one you can consider yourself an expert. Get two, and I'll be amazed. Get all three, and you can consider yourself a champion.

Program 97: Hello Again

What does the following program print?

  1 /************************************************
  2  * Normally I would put in a comment explaining *
  3  * what this program is nominally used for.     *
  4  * But in this case I can figure out no         *
  5  * practical use for this program.              *
  6  ************************************************/
  7 #include <stdio.h>
  8 #include <unistd.h>
  9 #include <stdlib.h>
 10
 11 int main()
 12 {
 13     printf("Hello ");
 14     fork();
 15     printf("\n");
 16     exit(0);
 17 }

(Next Hint 214. Answer 50.)

Note 

Most of the time when I tell this joke to non-technical people, they just look at me strangely. Technical people tend to think for a minute and then say, "You're right." Only one person in about a hundred actually laughs.

Table Of Contents
Previous Section Next Section