📄 stack.cpp
字号:
/*------------------------------------------------------------------------*/
/* */
/* 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 ) );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -