Create a class that allows you to treat the 10 separate arrays in Exercise 10 as a single
one-dimensional array, using array notation with a single index. That is, statements in
main() can access their elements using expressions like a[j],even though the class
member functions must access the data using the two-step approach. Overload the subscript
operator []
(see Chapter 9, “Inheritance”) to achieve this result. Fill the arrays
with test data and then display it. Although array notation is used in the class interface in
main() to access “array” elements, you should use only pointer notation for all the operations
in the implementation (within the class member functions).
Comments
Leave a comment