The Life of Objects
Everybody gets a little confused at first, when learning about C++ copy semantics, so don't worry if your head hurts a bit. An educator noted at a recent American Academy of Sciences meeting that the average soap opera is much more complicated than most mathematics. The C++ object model is certainly more straightforward than The Bold and the Beautiful (but then I probably don't watch enough TV). There are basically two ways to deal with objects:
Dynamically creating and destroying objects
Automatically creating and destroying objects
Dynamic Creation of Objects
You can create objects dynamically and use references or pointers to refer to them. In this case, assignment results in another alias to the object, and if you want ...
Get C++ By Example: UnderC Learning 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.