近期在学习C++ 的过程,由于时间仓促,基本知识未能及时整理(后期补充),为了巩固所学的知识,用C++语言来实现顺序栈。基本代码如下:
/*
** 题目:实现顺序栈
*/
#include<iostream>
#include<cstring>
#include <stdlib.h>
#include <time.h>
using namespace std;
class SqStack
{
private:
int *_pstack;
int _top;
int _size;
void resize()
{
int *ptmp = new int[_size *