Contents

Section 2.1 Primitive Built-in Types

Section 2.2 Variables

Section 2.3 Compound Types

Section 2.4 const Qualifier

Section 2.5 Dealing with Types

Section 2.6 Defining Our Own Data Structures

Chapter Summary

Defined Terms

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

C++ has extensive support for types. The language defines several primitive types (characters, integers, floating-point numbers, etc.) and provides mechanisms that let us define our own data types. The library uses these mechanisms to define more complicated types such as variable-length character strings, vectors, and so on. This chapter covers the built-in types and begins our coverage of how C++ supports ...

Get C++ Primer, Fifth 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.