Well, I just wanted to assign one object to another(both of different classes)
supposing
Destination Object=Source Object;
and I define a constructor in the destination object...(I am overloading the constructor to make more than one assignment)
Now, the error is after the call to constructor is made... a destructor is also called...
So anyone has any idea how i could clear this error??or suggest me an alternative for type conversion
class HostelAllotment
{
public:
int noboys;
int nogirls;
};
class Boys:public HostelAllotment
{
public:
~Girls(){cout<<"Detroying b";}
int x[6];
int bfees;
};
class Girls:public HostelAllotment
{
public:
~Girls(){cout<<"Detroying g";}
int x[6];
int gfees;
};
class admin:public Boys,public Girls
{
public:
admin(Boys a)
{
this->Boys::bfees=a.bfees;
for(int i=0;i<5;i++)
{
Boys::x[i]=a.x[i];
}
};