From the perspective of casting, new engine
produces a pointer of
type engine*
, a pointer to an engine
object. Then, because
train
is an array of pointers to railroad_car
objects, the
pointer of type engine*
is cast automatically into a pointer of type
railroad_car*
. The pointer still points, however, to a chunk of
memory holding an engine
object.