The problem is at this line:
A *c = new int();
The left hand side is OK, you declare
c
as a pointer to an
A
object. But the right hand side creates a pointer to an integer. But
c
is a pointer to an object of
A
, not an integer. So change it to:
A *c = new A(0);