#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