class ScreenList { // keep a list of ScreenObjs struct Window { ScreenObj * head; // a private structure Window * next; }; // to make a linked list Window * head; // start of list Window * current; // so we can step through list public: void add(ScreenObj &); // add to the list void remove(ScreenObj &); // remove a ScreenObj void reset() { current = head; } // go to beginning ScreenObj & GetNext(); // return the next one or zero at end }; main() { Message M; Reader R; Dialog D; Screenlist List; List.add(M); List.add(R); List.add(D); List.reset(); while( (ScreenObj & Win = List.GetNext()) != 0) Win.ReDraw(); // ReDraw the whole list }