Initialization of Composite Objects

The issues related to initialization play an important role in programming. Failure to initialize a computational object properly is a common source of programming errors. C++ offers the programmer a rich set of techniques for initialization of program components.

When I was describing the syntax of defining scalar variables in Chapter 3, "Working with C++ Data and Expressions," the next discussion topic was the syntax of giving initial values to these variables. When I was describing the syntax of C++ aggregates in Chapter 5, "Aggregation with Programmer-Defined Data Types," —arrays, structures, enumerations, unions, and bit fields—the next topic for discussion was the initialization of these program components. ...

Get Core C++ A Software Engineering Approach 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.