Chapter 2 Basic Concepts

This chapter explains some concepts that are key to the understanding of C++. While many of these concepts are familiar to C programmers, there are some subtle differences that can cause unexpected program results. Some of the topics covered in this chapter are:

Terminology. Terms used later in this book are introduced and defined.

Scope. The scope of a C++ object or function is different from C; the scoping rules are defined. See “Scope”.

Linkage. Linkage rules are described as is the definition of a “program.” See “Program and Linkage”.

Program startup, termination, and the main function. The sequence of startup and termination is discussed, as is defining the purpose and behavior of the main function. See “Startup and Termination”.

Storage classes. The treatment of auto and static objects in C++, including initialization and destruction, is discussed. See “Storage Classes”.

Types. The behavior of C++ fundamental (built-in) types is explained. The discussion includes derived types, type names, name spaces, and limits for each type. See “Types”.