Chapter 4

Trials and Errors

IN THIS CHAPTER

check Printing text to the screen

check Disabling statements by using comments

check Fixing compiler errors

check Using the printf() function

check Enjoying escape sequences

check 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 ...

Get C Programming For Dummies, 2nd 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.