Everything goes well until I get to the last statement before the pause. I think it's calling my Dimensions constructor again when the getVolume() function is called. Can someone explain to me, why?
Why am I getting zeros back from a classusing inheritance?
you are getting zerros because you didn't initialze heigth and width for _cube object, you initialize just length (z).
so width and height in _cube object are both an big zerro.
object _dims is (which holds heigth and width is independed of _cube
also _cube is independed from _dims, they dot now nothing about each oter cose these are two objects not one.
why?
object _cube has everyting what _dims has but _dims does not have everyting what _cube has
so?
to initialize object as you intended in your code above delete _dims and call all metods for _cube only cos _cube is _cube and _dims in same time because _cube has inherit _dims.
that is inheritance.
call same member functoins on _cube as you would on _dims and you got it.