home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
OTHERUTI
/
TCPP30-1.ZIP
/
CLASSSRC.ZIP
/
STACK.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-18
|
1KB
|
38 lines
/*------------------------------------------------------------------------*/
/* */
/* STACK.CPP */
/* */
/* Copyright Borland International 1991 */
/* All Rights Reserved */
/* */
/*------------------------------------------------------------------------*/
#if !defined( __STACK_H )
#include <Stack.h>
#endif // __STACK_H
#ifndef __IOSTREAM_H
#include <iostream.h>
#endif
void Stack::push( Object& toPush )
{
theStack.add( toPush );
itemsInContainer++;
}
Object& Stack::pop()
{
Object& temp = theStack.peekHead();
theStack.detach( temp );
if( temp != NOOBJECT )
itemsInContainer--;
return temp;
}
ContainerIterator& Stack::initIterator() const
{
return *( (ContainerIterator *)new ListIterator( this->theStack ) );
}