?? stack.cpp
字號:
// 堆棧類 Stack的實現(xiàn) ,實現(xiàn)壓入、彈出操作
#include <iostream >
#include "stack.h"
using namespace std;
template <class T> //類模板的成員函數(shù)的實現(xiàn)
void Stack<T>::push(T a)
{
if ( IsFull() )
{
cout << "Full of Stack"<<endl;
}
else
{
*(data+top++) = a;
}
}
template <class T> //類模板的成員函數(shù)的實現(xiàn)
T Stack<T>::pop()
{
if ( IsEmpty() )
{
cout << "Empty of Stack"<<endl;
}
return (*(data+ -- top));
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -