/* File: ccmain.C Use the ColorCube class. */ #include #include "colorcube.h" main() { ColorCube c1 ; /* use default constructor */ ColorCube c2 = ColorCube(1.2, blue) ; /* use alternate constructor */ printf("\nIdentify:\n") ; printf("c1: ") ; c1.identify() ; printf("c2: ") ; c2.identify() ; if (compare(c1,c2) < 0) { printf ("Cube c1 fits inside cube c2\n") ; } /* Member functions of Box class still accessible because ColorCube is a public derivation of Cube which is a public derivation of Box. */ printf("\nGrow c1:\n") ; c1.grow() ; c1.identify() ; }