topical media & game development
basic-program-code-09-Ex9-06-Ex9-06.c
? /
basic-program-code-09-Ex9-06-Ex9-06.c
// Ex9_06.cpp
// Behavior of inherited functions in a derived class
include <iostream>
include <GlassBox.h> // For CBox and CGlassBox
using std::cout;
using std::endl;
int main()
{
CBox myBox(2.0, 3.0, 4.0); // Declare a base box
CGlassBox myGlassBox(2.0, 3.0, 4.0); // Declare derived box - same size
myBox.ShowVolume(); // Display volume of base box
myGlassBox.ShowVolume(); // Display volume of derived box
cout << endl;
return 0;
}
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.