/* File: pmain1.C Use the Package class. */ #include #include "package.h" main() { Package p1 ; Package p2 = Package(2.0, 2.0, 2.0) ; Package p3 = Package(2.1, 3.0, 2.5) ; Package *ptr ; int r ; printf("p1: ") ; p1.identify() ; printf("p2: ") ; p2.identify() ; printf("p3: ") ; p3.identify() ; printf("\nStore:\n") ; r = p2.Store(&p1) ; printf("store p1 in p2, r=%d\n", r) ; p3.Store(&p2) ; printf("store p2 in p3, r=%d\n", r) ; p3.identify() ; printf("\nContent:\n") ; ptr = p2.Content() ; ptr->identify() ; printf("\nEmpty:\n") ; ptr = p3.Empty() ; printf("p3: ") ; p3.identify() ; printf("*ptr: ") ; ptr->identify() ; }