fork(17) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class A {
  5. public:
  6. virtual void f();
  7. };
  8.  
  9. virtual void A::f() {}
  10.  
  11. int main() {
  12. // your code goes here
  13. return 0;
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:9:19: error: ‘virtual’ outside class declaration
 virtual void A::f() {}
                   ^
stdout
Standard output is empty