Home Segments Index Top Previous Next

430: Mainline

Now it is time to develop a program that uses an array of pointers to class objects. The program is a modification of the program in Segment 388 that reads cylinder radii and lengths, puts them into an array of cylinder objects, and displays their total volume.

The modified program does the same work, but differs in that memory is allocated for the pointers at compile time, leaving memory for the cylinder objects to be allocated at run time.