C++???????????????
???????????? ???????[ 2015/12/29 11:44:33 ] ??????????????????? .NET
??????д??????????????????к??д???????????????????
CStock & CStock::operator =(const CStock & otherStock)
{
CStock tempStock;
Item * copyElement = otherStock.p_Top;
//???otherStock????????????ν???tempStock???????λ??????otherStock????
while(copyElement)
{
tempStock.push(copyElement->data);
copyElement = copyElement->p_next;
}
copyElement = tempStock.p_Top;
//??tempStock????????????ν???????????λ?ú?otherStock?????
while(copyElement)
{
push(copyElement->data);
copyElement = copyElement->p_next;
}
return *this;
}
//???????
void CStock::push(elemType x)
{
Item * pushElement = new Item;
pushElement->data = x;
if(!p_Top)//?????????
{
p_Top = pushElement;
pushElement->p_next = NULL;
}
else //?????????
{
pushElement->p_next = p_Top;
p_Top = pushElement;
}
}
//???????????????????????????x???????????????????????????false;
bool CStock::pop(elemType &x)
{
if(!p_Top)
{
return false;
}
x = p_Top->data;
p_Top = p_Top->p_next;
return true;
}
//??????????
bool CStock::isEmpty() const
{
return p_Top == NULL;
}
//??????????????
void CStock::clear()
{
Item * deleteElement;
while(p_Top)
{
deleteElement = p_Top;
p_Top = p_Top->p_next;
delete deleteElement;
}
}
//???????С
int CStock::size() const
{
int length = 0;
Item *temp = p_Top;
while(temp && ++length)
{
temp = temp->p_next;
}
return length;
}
//?????????
void CStock::print() const
{
int count = 0;
Item * temp = p_Top;
while(temp && ++count)
{
cout << temp->data << " ";
if(count % 5 == 0)
cout << endl;
temp = temp->p_next;
}
}
//????????????????????????????????????????
CStock::~CStock(void)
{
Item * deleteElement;
while(p_Top)
{
deleteElement = p_Top;
p_Top = p_Top->p_next;
delete deleteElement;
}
}
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??C++????????????C++ lvalue??rvalueC++11????????C++???????????????C++?е?????????????????C++?????????C++???Windows????λ??C/C++???????????????????JAVA??C??C++??????????c++??python???????????????????????????????C++???????C++?е????????C++????????????????C++ ???????????????C++?????????????????????C++????????????
???·???
??????????????????
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????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????