Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 8 years ago

Language

Compiler

Options

Author

anonymous

almost 8 years ago

$
prog.cc: In function 'int main()':
prog.cc:14:10: error: cannot declare variable 'aBase' to be of abstract type 'Base'
     Base aBase;
          ^
prog.cc:1:8: note:   because the following virtual functions are pure within 'Base':
 struct Base
        ^
prog.cc:5:18: note: 	virtual void Base::func()
     virtual void func() = 0;
                  ^
prog.cc:15:24: error: invalid new-expression of abstract class type 'Base'
     Base* aBasePtr=new Base;
                        ^
prog.cc:16:13: error: cannot declare variable 'aDerived' to be of abstract type 'Derived'
     Derived aDerived;
             ^
prog.cc:7:8: note:   because the following virtual functions are pure within 'Derived':
 struct Derived : public Base
        ^
prog.cc:5:18: note: 	virtual void Base::func()
     virtual void func() = 0;
                  ^
prog.cc:17:30: error: invalid new-expression of abstract class type 'Derived'
     Derived* aDerivedPtr=new Derived;
                              ^
Exit Code:
1