O'Reilly logo

C Primer Plus, Fourth Edition by Stephen Prata

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Explanation

We'll take two passes through the program's source code. The first pass highlights the meaning of each line, and the second explores specific implications and details.

Figure 2.1 summarizes the parts of a C program; it includes more elements than our first example uses.

Figure 2.1. Anatomy of a C program.

Pass 1 Quick Synopsis

#include <stdio.h>   ←include another file

This line tells the compiler to include information found in the file stdio.h, which is a standard part of all C compiler packages.

int main(void)       ←a function name

C programs consist of one or more functions, the basic modules of a C program. This program consists ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required