More Definitions

A concrete data type is a class whose objects behave like variables of native data types. That is, the class gives the compiler enough information that its objects can be created, copied, assigned, and automatically destroyed just as native variables are. The StockItem class that we will construct in this chapter is a concrete data type.

A constructor is a member function that creates new variables of the class to which it belongs. All constructors have the same name as the class for which they are constructors; therefore, the constructors for StockItem variables also have the name StockItem.

A default constructor is a constructor that is used when no initial value is specified for an object. Because it is a constructor, it ...

Get Learning to Program in C++ 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.