

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Homework # CS 325 Due: 9:30 am on Tuesday 17-Feb
Answer the following questions in detail:
More than one thread can correctly run the function simultaneously – thus no locking, racing, etc.
Consider the following declarations:
virtual void B0::basicFunction() void Y::basicFunction() virtual void X::basicFunction() void W::basicFunction()
then describe the polymorphic behavior of the pointers:
B0 *b0_ptr; Y *y_ptr; X *x_ptr; W *w_ptr;
Overriding a member function replaces a function with the same name through inheritance: the most recent inherited class may redefine a member function with the same name.
Overloading a function allows several functions with different signatures to have the same name.
Destructors are always invoked in the opposite order of the constructors. Thus, making a destructor virtual ensures the destructor associated with the pointer is
invoked which in turn invokes the rest of the destructors in the inverse order as the constructors.
Each class with a virtual member function (or inheriting virtually) has a virtual pointer table v_ptr. Thus all classes that inherit from a class with a v_ptr table access this table. More later…