home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
bc45
/
clobss.pak
/
STACK.CPO
< prev
next >
Wrap
Text File
|
1997-07-23
|
1KB
|
34 lines
/*------------------------------------------------------------------------*/
/* */
/* STACK.CPP */
/* */
/* Copyright Borland International 1991, 1993 */
/* All Rights Reserved */
/* */
/*------------------------------------------------------------------------*/
#if !defined( __STACK_H )
#include "classlib\obsolete\stack.h"
#endif // __STACK_H
void Stack::push( Object& toPush )
{
list.add( toPush );
itemsInContainer++;
}
Object& Stack::pop()
{
Object& temp = list.peekHead();
list.detach( temp );
if( temp != NOOBJECT )
itemsInContainer--;
return temp;
}
ContainerIterator& Stack::initIterator() const
{
return *( (ContainerIterator *)new ListIterator( list ) );
}