June 2025
Intermediate to advanced
1093 pages
33h 24m
English
We’ve covered a lot of ground so far in this chapter. Before we dive deeper into how to make usage of your own data types, let’s take a breather and recall the key lessons learned so far:
Use struct to create new types.
Global functions can operate on parameters of the new type and return the new type as a result.
Methods keep data and functions together.
Avoid using global variables directly in functions and methods.
You can define operator<<(ostream&,…) and use it to output your type.
Separate the declaration and definition of methods by splitting them into header and implementation files.
Divide your type into private and public sections using public and private.
Use struct or class to clarify your intention ...
Read now
Unlock full access