#include <stdlib.h> #include <stdio.h> class A { public: A(); ~A(); virtual int funA(int a) = 0; }; A::A() { printf("A constructor/n"); } A::~A() { printf("A destructor /n"); } class B : public A { public: B(); ~B(); int funA(int a); private: int t; }; int B:: funA(int a) { t = a; printf(" t = %d /n " ,t ); return t; } B::B() { printf("B constructor /n"); } B::~B() { printf("B destructor /n"); } int main() { A * ta = new B(); int t= ta->funA(123); delete ta; return 0; }