8. Classes and Structs
Overview
This chapter presents the fundamentals of structs and classes with the aid of practical examples and exercises. By the end of this chapter, you will be able to describe the differences between the class, struct and union types as well as how to correctly initialize and dispose of them using constructors and destructors.
Introduction
C++ is an extensive language, and each feature or paradigm you come to learn about will require in-depth knowledge to unlock its full potential. C++ has two kinds of types: built-in types and class types. Built-in types are any types that make up the core of the language, such as int, float, and char. Class types can be thought of as user-defined types; these are the types we ...
Get The C++ Workshop 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.