This is a longish example with a base class phonerec and a derived class phonebillrec. All methods have a cout so you can see when they are called and the order of calling.
This example is too long to list here but the main part is
int main(int argc, char* argv[])The output is
{
phonebillrec p; // calls a default parameter "Me"
cout << "----" << endl;
phonebillrec p2(23.45) ;
cout << "----" << endl;
p2.name="Fred";
phonebillrec p3(p2) ;
cout << "----" << endl;
phonebillrec p4;
cout << "----" << endl;
p4=p2;
cout << "----" << endl;
cout << "Name = " << p3.name << endl;
return 0;
}
Default Constructor phonerec
Default Constructor phonebillrec
----
Default Constructor phonerec
Default Constructor phonebillrec
----
Copy Constructor phonerec
Copy Constructor phonebillrec
----
Default Constructor phonerec
Default Constructor phonebillrec
----
Assignment Operator phonerec
Assignment Operator phonebillrec
----
Name = Fred
On the next page : More about Example 1

