fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Abstract{
  5. virtual void method () = 0;
  6. public:
  7. Abstract(int a){};
  8. };
  9.  
  10. int main() {
  11. Abstract a;
  12. return 0;
  13. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:11:11: error: no matching function for call to ‘Abstract::Abstract()’
  Abstract a;
           ^
prog.cpp:11:11: note: candidates are:
prog.cpp:7:2: note: Abstract::Abstract(int)
  Abstract(int a){};
  ^
prog.cpp:7:2: note:   candidate expects 1 argument, 0 provided
prog.cpp:4:7: note: constexpr Abstract::Abstract(const Abstract&)
 class Abstract{
       ^
prog.cpp:4:7: note:   candidate expects 1 argument, 0 provided
prog.cpp:4:7: note: constexpr Abstract::Abstract(Abstract&&)
prog.cpp:4:7: note:   candidate expects 1 argument, 0 provided
prog.cpp:11:11: error: cannot declare variable ‘a’ to be of abstract type ‘Abstract’
  Abstract a;
           ^
prog.cpp:4:7: note:   because the following virtual functions are pure within ‘Abstract’:
 class Abstract{
       ^
prog.cpp:5:15: note: 	virtual void Abstract::method()
  virtual void method () = 0;
               ^
stdout
Standard output is empty