Quote:
|
Originally Posted by shirish_nagar
So, even after you called Destructor, object is still there.
|
r we calling the destructor?
i doubt...i think the destructor is calld automatically...see this...
class abc
{
data....
print()
~abc()
{
printf("Hello\n");
}
};
main()
{
abc a1;
a1.print();
}
the output wud contain "Hello" on last line......
this means when the object has been
used and it is the end of the program, the destructor function is
implicitly called
to free up memory space allocated to object.....
wud this not mean that a destructor is called to destroy the object?