| <<< Copy constructor example | Index | >>> |
Called when an object is passed to a function...
...but not if passed by reference!
Called when an object is returned from a function
Called when one object is used to initialize another:
Point pt1( 5, 10 );
Point pt2 = pt1; // Initializer syntax is preferred!
Point pt3( pt1 ); // Constructor syntax -- avoid
| <<< Copy constructor example | Index | >>> |