fork download
  1. #include <iostream>
  2. using namespace std;
  3. struct Base
  4. {
  5. ~Base(){
  6. }
  7. virtual void foo() const{
  8. }
  9. virtual void bar() const{
  10. }
  11. };
  12.  
  13. struct A : Base
  14. {
  15. ~A() override{//den exei virtual ara skaei
  16. }
  17.  
  18. void foo() override{//den exei const ara skaei
  19. }
  20.  
  21. void bar() const override{//ok
  22. }
  23. };
  24.  
  25. int main() {
  26. // your code goes here
  27. return 0;
  28. }
Compilation error #stdin compilation error #stdout 0s 3472KB
stdin
Standard input is empty
compilation info
prog.cpp:15:2: error: ‘A::~A()’ marked override, but does not override
  ~A() override{//den exei virtual ara skaei
  ^
prog.cpp:18:7: error: ‘void A::foo()’ marked override, but does not override
  void foo() override{//den exei const ara skaei
       ^
stdout
Standard output is empty