Chapter 8

  1. The statement putchar(getchar()); causes the program to read the next input character and to print it; the return value from getchar() is the argument to putchar(). No, getchar(putchar()) is invalid because getchar() doesn't use an argument and putchar() needs one.

    1. Display the H character.

    2. Sound the alert if the system uses ASCII.

    3. Move the cursor to the beginning of the next line.

    4. Backspace.

  2. count <essay >essayct or else count >essayct <essay

  3. Just c. is valid.

  4. It's a signal (a special value) returned by getchar() and scanf() to indicate that they have detected the end of a file.

    1. The output is as follows:

      If you qu
      

      Note that the character I is distinct from the character i. Also note that the i is not printed because the loop quits upon detecting ...

Get C Primer Plus®, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.