C++???????????????
???????????? ???????[ 2015/12/29 11:44:33 ] ??????????????????? .NET
????????????д???????????????б??????????????????????
???????????????????????????????
??????????????????????£?
#ifndef CSTOCK_H_
#define CSTOCK_H_
typedef int elemType;
struct Item
{
elemType data;
Item * p_next;
};
class CStock
{
public:
CStock();
CStock(const CStock & otherStock); //??????????????
CStock & operator = (const CStock & otherStock); //=??????????
void push(elemType x);//?????????
bool pop(elemType &x); //?????????
bool isEmpty() const; //???????
void clear();//????????????
int size() const; //???????С??
void print() const; //??????????
~CStock();
public:
Item *p_Top;//???
};
#endif
??????????????????????£?
#include "CStock.h"
#include <iostream>
using std::cout;
using std::endl;
CStock::CStock(): p_Top(NULL)//??????
{
}
//?????????? ????????????????? CStock s1 = stock; ???????????????
CStock::CStock(const CStock & otherStock):p_Top(NULL)
{
*this = otherStock;
}
// =???????????????????磺CStock s1; .... CStock s2; s2 = s1; ???????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11