[ create a new paste ] login | about

Link: http://codepad.org/lBWaEefT    [ raw code | output | fork ]

dakotahawkins - C++, pasted on Oct 18:
#include <stdio.h>

class Base
{
public:
  Base() {}
  ~Base() {}

  virtual void run() = 0;
};
class Child : public Base
{
public:
  Child() {}
  ~Child() {}
  void run() { printf("Child::run()\n"); }
};

int main ()
{
   Base *c = new Child();
   c->run();
   delete c;

  return 0;
}


Output:
1
Child::run()


Create a new paste based on this one


Comments: