Question: (a) Describe the difference between an instance member variable and a static member variable. (b) Assume that a class named Numbers has the following static

(a) Describe the difference between an instance member variable and a static member variable.

(b) Assume that a class named Numbers has the following static member function declaration:

static void showTotal()

Write a statement that calls the showTotal function

(c) A static member variable is declared in a class. Where is the static member variable defined?

(d) What is a friend function?

(e) Why is it not always a good idea to make an entire class a friend of another class?

(f) What is memberwise assignment?

(g) When is a copy constructor called?

(h) How can the compiler determine if a constructor is a copy constructor?

(i) Describe a situation where memberwise assignment is not desirable.

(j) Why must the parameter of a copy constructor be a reference?

(k) What is a default copy constructor?

(l) Describe the difference betwen making a class a member of another class (object aggregation), and making a class a friend of another class. item What is the purpose of a forward declaration of a class?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!