fork download
  1. class Accounts{};
  2.  
  3. class SavingAccounts:public Accounts{};
  4.  
  5. void doSomething(SavingAccounts &obj)
  6. {
  7. }
  8.  
  9. int main()
  10. {
  11. Accounts obj;
  12. doSomething(obj);
  13. return 0;
  14. }
  15.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:12: error: invalid initialization of reference of type ‘SavingAccounts&’ from expression of type ‘Accounts’
prog.cpp:5: error: in passing argument 1 of ‘void doSomething(SavingAccounts&)’
stdout
Standard output is empty