Chapter 4
The program bombs. The first scanf() statement reads just your first name, leaving your last name untouched but still stored in the input "buffer." (This buffer is just a temporary storage area used to store the input.) When the next scanf() statement comes along looking for your weight, it picks up where the last reading attempt ended, and tries to read your last name as your weight. This frustrates scanf(). On the other hand, if you respond to the name request with something like Lasha 144, it uses 144 as your weight, even though you typed it before your weight was requested.
He sold the painting for $234.50.
Hi!
(Note: The first character is a character constant, the second is a decimal integer converted to a character, and the third ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access