V
Vulcan Fire
Hi
Had this doubt really irking me for some time.
For some obj of type say Obj.
void fn(Obj o){
// do somethng
}
main {
Obj ob;
fn(ob); // no COPY C'TOR d'fined
}
Doubt -> Why is that in fn() inspite of a bitcopy of the obj being
done the destructor is still called. If the object itself hasn't been
constructed & rather a bit copy's done shouldnt the destructor also
not be called when fn() exits.
Regards
Ad Varma
Had this doubt really irking me for some time.
For some obj of type say Obj.
void fn(Obj o){
// do somethng
}
main {
Obj ob;
fn(ob); // no COPY C'TOR d'fined
}
Doubt -> Why is that in fn() inspite of a bitcopy of the obj being
done the destructor is still called. If the object itself hasn't been
constructed & rather a bit copy's done shouldnt the destructor also
not be called when fn() exits.
Regards
Ad Varma