Chapter 8
1: | putchar(getchar()) is a valid expression; what does it do? Is getchar(putchar()) also valid? |
A1: | 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. |
2: | What would each of the following statements accomplish?
|
A2: |
|
3: | Suppose you have a program count that counts the characters in its input. Devise a command that counts the number of characters in ... |
Get C Primer Plus, Fourth 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.