[ create a new paste ] login | about

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

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

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

  virtual void run();
};
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
2
3
In function `main':
undefined reference to `vtable for Base'
t.o:(.gnu.linkonce.r._ZTI5Child+0x8): undefined reference to `typeinfo for Base'


Create a new paste based on this one


Comments: