记录详情

Compile Error

/in/foo.cc:22:9: error: 'double Account::getBalance()' cannot be overloaded
  double getBalance();
         ^~~~~~~~~~
/in/foo.cc:12:9: error: with 'double Account::getBalance()'
  double getBalance() { return balance; }
         ^~~~~~~~~~
/in/foo.cc:73:8: error: redefinition of 'double Account::getBalance()'
 double Account::getBalance()
        ^~~~~~~
/in/foo.cc:12:9: note: 'double Account::getBalance()' previously defined here
  double getBalance() { return balance; }
         ^~~~~~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:124:5: error: 'class Account' has no member named 'setBalance'; did you mean 'getBalance'?
   a.setBalance(0);
     ^~~~~~~~~~
/in/foo.cc: In member function 'double CheckingAccount::debit(double)':
/in/foo.cc:113:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

信息

递交者
类型
递交
题目
P1006 11.10 Account_Inheritance
语言
C++
递交时间
2020-03-20 22:00:17
评测时间
2020-03-20 22:00:17
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes