Summary

In this hour you learned how to overload member functions of your classes. You also learned how to supply default values to functions, how to decide when to use default values, and when to overload.

Overloading class constructors enables you to create flexible classes that can be created from other objects. The initialization of objects happens at the initialization stage of construction, which is more efficient than assigning values in the body of the constructor.

The copy constructor is supplied by the compiler if you don't create your own, but it creates a shallow copy of the class. In classes in which member data includes pointers to the heap, this method must be overridden so that you allocate memory for the target object.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.101.72