O'Reilly logo

C++ Primer, Fourth Edition by Barbara E. Moo, Josée Lajoie, Stanley B. Lippman

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

Chapter 2. Variables and Basic Types

CONTENTS

Section 2.1 Primitive Built-in Types 34

Section 2.2 Literal Constants 37

Section 2.3 Variables 43

Section 2.4 const Qualifier 56

Section 2.5 References 58

Section 2.6 Typedef Names 61

Section 2.7 Enumerations 62

Section 2.8 Class Types 63

Section 2.9 Writing Our Own Header Files 67

Chapter Summary 73

Defined Terms 73

Types are fundamental to any program. They tell us what our data mean and what operations we can perform on our data.

C++ defines several primitive types: characters, integers, floating-point numbers, and so on. The language also provides mechanisms that let us define our own data types. The library uses these mechanisms to define more complex types such as variable-length character ...

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