fork(2) download
  1. #include <stdio.h>
  2.  
  3. struct Object{
  4. virtual void method(){};
  5. virtual ~Object() = 0;
  6. };
  7.  
  8. Object::~Object(){}
  9.  
  10. int main(){
  11. Object obj;
  12. return 0;
  13. }
  14.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:11:9: error: cannot declare variable ‘obj’ to be of abstract type ‘Object’
  Object obj;
         ^
prog.cpp:3:8: note:   because the following virtual functions are pure within ‘Object’:
 struct Object{
        ^
prog.cpp:8:1: note: 	virtual Object::~Object()
 Object::~Object(){}
 ^
stdout
Standard output is empty