Guest User

Untitled

a guest
Jun 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Foo{
  5. public:
  6. virtual void foo() = 0;
  7. // virtual void foo() = 42; //error in compilation
  8. // virtual void foo() = NULL; //error in compilation
  9. };
  10.  
  11. class Bar : public Foo{
  12. public:
  13. virtual void foo(){
  14. cout << "g++" __VERSION__ << endl;
  15. };
  16. };
  17.  
  18. int main(){
  19. Foo * f = new Bar();
  20. f->foo();
  21. delete f;
  22. }
Add Comment
Please, Sign In to add comment