记录详情

Compile Error

/in/foo.cc:23:9: error: 'double Account::getBalance()' cannot be overloaded
  double getBalance();
         ^~~~~~~~~~
/in/foo.cc:13:9: error: with 'double Account::getBalance()'
  double getBalance() { return balance; }
         ^~~~~~~~~~
/in/foo.cc: In member function 'double Account::debit(double)':
/in/foo.cc:69:2: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
  else
  ^~~~
/in/foo.cc:71:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else'
   return balance;
   ^~~~~~
/in/foo.cc: At global scope:
/in/foo.cc:74:8: error: redefinition of 'double Account::getBalance()'
 double Account::getBalance()
        ^~~~~~~
/in/foo.cc:13:9: note: 'double Account::getBalance()' previously defined here
  double getBalance() { return balance; }
         ^~~~~~~~~~
/in/foo.cc: In member function 'double CheckingAccount::debit(double)':
/in/foo.cc:114:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

信息

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