Chapter 4
Trials and Errors
IN THIS CHAPTER
Printing text to the screen
Disabling statements by using comments
Fixing compiler errors
Using the printf() function
Enjoying escape sequences
Fixing linking errors
One of the nifty things about computer programming is that feedback is immediate. You’re informed right away when something goes awry, by the compiler, the linker, or the program not running the way you intended. Believe it or not, that’s the way everyone programs! Errors happen, and even the most experienced programmer expects them.
Display Stuff on the Screen
The best way to get started programming is to create tiny code samples that merely toss up some text on the screen. It’s quick. And you learn something while you do it.
Displaying a humorous message
A computer is known as a serious device, so why not add some levity?
Exercise 4-1: Carefully type the code from Listing ...
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