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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started