例如:
我想从数组中减去,account[1].GetBalance
.
当我尝试做时account[1].GetBalance = account[1].GetBalance - withdrawal
,它说表达式不可分配。
如何获取值account[1].GetBalance
来操作数据?
void Account::SetBalance(double balance)
{
balance_ = balance;
}
double Account::GetBalance()
{
return balance_;
}