Lesson 2. The Components of a C Program

Every C program consists of several components combined in a specific way. Most of this book is devoted to explaining these various program components and how you use them. To help illustrate the overall picture, you should begin by reviewing a complete (though small) C program with all its components identified. In this lesson you learn:

Image The components of a short C program

Image The purpose of each program component

How to compile and run a sample program

A Short C Program

Listing 2.1 presents the source code ...

Get C Programming in One Hour a Day, Sams Teach Yourself, 7th 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.