|
||||||||
C++: Set 1Discussion Questions 1. Assume a class D that is privately derived from class B. An object of class D in main() can access
a. public members of D.
2. A class D can be derived from a class C, which is derived from a class
B, which is derived from a class A. a. True 3. Assume a class D derived from a base B. Both classes contain a member function foo() that takes no arguments. Write a statement that is in a member function of D that calls foo() in the base class.
B::foo(); 4. Write the first line of a specifier for a class AB that is derived from class A and from class B.
class AB : public A, public B 5. Assume a base class B with a public member function bFunc(), and class D is derived from B. Write a statement that allows an object of D to access bFunc().
obj.bFunc(); // assume obj is an instance of D
6. It is illegal to make objects of one class members of another class.
|
||||||||
© Lynne Grewe |