編輯:我試圖創建一個客戶類,但有功能的問題。多繼承函數
這些是要遵循的指令:派生一個新類 - 客戶類(繼承自儲蓄 - 儲蓄繼承自銀行賬戶) 編寫客戶類。 Customer類具有以下新的屬性 客戶名稱
關於如何解決我的職能的任何方向將有助於
#include "BankAccount.h"
#include "SavingsAccount.h"
#include <iostream>
class Customer : public SavingsAccount, public BankAccount {
protected:
string CustomerName;
public:
string getCustomerName();
void setCustomerName(string);
void WithdrawSavings(){ Customer c; c.BankAccount::balance(); }
void DepositSavings(double);
Customer(){
CustomerName = "";
}
};
這裏有太多明顯的問題。你有更多的根本問題,而不僅僅是這個編譯錯誤。這個問題是無法挽救的... –
您確定客戶是_Sales_Account和BankAccount嗎? –