Answer Posted / sujatha
object can be destroyed by using DESTRUCTORS
EX:
class A
{
int p;
public:
A(int x)
{
x=p;
cout<<"constructor is called memory is allocated to
variable x\n";
}
void show()
{
cout<<"x="<<x;
}
~A()
{
cout<<"destructor called and deaalocte memory occupied by
x\n";
}
};
void main()
{
A a1(10);
a1.show();
}
output
constructor called memory is allocated to variable x
x=10
destructor called and deaalocte memory occupied by x
| Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
What do you mean by abstraction?
What is the renewal class?
What is oops concept with example?
What causes polymorphism?
What are the three main types of variables?
What are objects in oop?
What is polymorphism used for?
write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory
What is overriding vs overloading?
is there any choice in opting subjects like 4 out of 7
What is a function in oop?
What do you mean by variable?
Get me an image implementation program.
What is class and object in oops?
What is static modifier?