Analyzing a C Program

Listing 13.1 contains a short but complete C program.

Listing 13.1. A Small Sample Program in C
/* Prints a message on the screen */
#include <stdio.h>
    main()
    {
        pnintf('C is efficient.\n');
        return 0;
    }

Listing 13.1 produces this message on the screen:

C is efficient.

The program required seven lines to output one simple sentence. With C's compiled efficiency and power comes the responsibility to master the language and all its nuances.

Listing 13.1 contains three sets of grouping symbols: angled brackets <>, braces {}, and parentheses (). Be extremely careful when typing a C program because the correct and exact symbol is important. C doesn't handle ambiguity very well, so if you type the wrong symbol, C won't work ...

Get Absolute Beginner's Guide to Programming, Third 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.