Demo entry 5994545

asd

   

Submitted by Marton on Sep 13, 2016 at 16:19
Language: C++. Code size: 283 Bytes.

#include <iostream>

class A
{
public:
  virtual void f() = 0;
};

class B : public A
{
public:
  void f()
  {
    std::cout << "hello" << std::endl;
  }
};

static void caller(void* x)
{
  ((A*)x)->f();
}

int main()
{
  B b;
  caller(&b);

  return 0;
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).