/* Copyright (c) 1997 Oxford University Press. All Rights Reserved. This code is from "Data Structures via C++: Objects by Evolution", published by Oxford University Press. Permission is hearby granted to use this code for any educational, non-commercial purpose, provided this notice remains intact. A. Michael Berman, Rowan University, berman@rowan.edu http://www.rowan.edu/evolve */ // RCS $Id: cx7-2.h,v 1.1 1997/08/07 20:50:36 berman Exp $ // cx7-2.h // Code Example 7-2: header file for list implemented with an array //#include "dslib.h" // the type of the individual elements in the list is defined here typedef char ListElementType; // the maximum size for lists is defined here const int maxListSize = 1000; class List { public: List(); void insert(const ListElementType & elem); bool first(ListElementType & elem); bool next(ListElementType & elem); private: ListElementType listArray[maxListSize]; int numberOfElements; int currentPosition; };