/* ECP: FILEname=fig14_30.cpp */ /* 1*/ main( void ) /* 2*/ { /* 3*/ const NumShapes = 5; /* 4*/ Shape *Array[ NumShapes ]; // 5 pointers to shapes. /* 5*/ // Read the shapes. /* 6*/ for( int i = 0; i < NumShapes; i++ ) /* 7*/ { /* 8*/ cout << "Enter a shape: "; /* 9*/ cin >> Array[ i ]; /*10*/ } /*11*/ Shellsort( Array, ( unsigned int ) NumShapes ); /*12*/ cout << "Sorted by increasing size:" << endl; /*13*/ for( i = 0; i < NumShapes; i++ ) /*14*/ cout << *Array[ i ]; /*15*/ return 0; /*16*/ }