is it valid output ?

#include <iostream>
#include<stdio.h>
using namespace std;
class a
{
        
    public:
        int xx;
    a()
    {
        cout << "in CONS a \n";

    }
    ~a()
    {
        cout << "in DES a \n";
    }

};

class b : public a
{
    public:
    int yy;    
    b()
    {
        yy=1;
        cout << "in CONS b \n";

    }

    ~b()
    {
        cout << "in DES b \n";
    }

};


int main()
{
    a *obj=new b();
    //cout <<"value of b.yy is " << obj->yy ;
    cout <<"size of int " << sizeof(int);
    cout << sizeof(a);
    cout << sizeof(b);
    cout << sizeof(*obj);

    delete obj;
    return 0;
}

o/p is not showing in DES b ! why ?
IS there any memory leaks?
pls clarify in detail

Please use ENGLISH... "o/p" is probably output; "pls" is PLEASE. This is a bulletin board, not a chat window.

The answer: Yes there is a memory leak. Why? Because the variable obj is a POINTER to an object of class A. The only methods accessible to class A are the constructor and destructor for class A. So, delete can call only these methods.

You can "fix" this simply by casting obj into a pointer to class B:

delete (b*)obj;