?? cstack.cpp
字號:
#include "stdafx.h"
#include "CStack.h"
charstack::charstack()
{
clear();
}
void charstack::clear()
{
top=0;
bottom=0;
memset(stack, 0, sizeof(stack));
}
charstack::~charstack()
{
}
void charstack::push(char p, char a)
{
ASSERT(top+2 < sizeof(stack));
stack[top++] = p;
stack[top++] = a;
}
void charstack::pop(char &q, char &a)
{
ASSERT(top >= 2);
a = stack[--top];
stack[top] = 0;
q = stack[--top];
stack[top] = 0;
}
bool charstack::empty()
{
if(top <= bottom)
return true;
return false;
}
void charstack::push(char p)
{
ASSERT(top+1 < sizeof(stack));
stack[top++] = p;
}
void charstack::pop(char &q)
{
ASSERT(top >= 1);
q = stack[--top];
stack[top] = 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -