[英]overloaded assignment operator bus error
由於某種原因,我的賦值運算符在嘗試使用它時會產生總線錯誤:
hand1 = hand2;
//overload assignment operator
Hand Hand::operator=(Hand other_hand)
{
if(&other_hand != this){
name = other_hand.name;
cards = other_hand.cards;
}
return *this;
}
返回語句后立即發生錯誤
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.