void AppClass:: list() { Thing *theThing; ArrayItr *theItr = new ArrayItr(testArray,testArray->getSize() ); int i = 0; bool result = theItr->getNext(theThing); while(result) { cout << i+1 << ":ID = " << theThing->getID() <<" Name = " << theThing->getName() << "." <<endl; result = theItr->getNext(theThing); i++; } }
void AppClass:: retrieve() { int pos; cout<<"\nEnter an array position: "; cin >> pos; Thing * theThing ; bool result = testArray->getElement(pos,theThing); if(result) { cout << "\nThe Thing at " << pos << " has an ID of " << theThing->getID() << " and a name of " << theThing->getName() << "." << endl; } else { cout << "The position is out of Range." <<endl; } }