Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is use to destroy an object? illustrate.

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


Please Help Members By Posting Answers For Below Questions

What do you mean by abstraction?

1054


What is the renewal class?

2742


What is oops concept with example?

1001


What causes polymorphism?

1118


What are the three main types of variables?

1111


What are objects in oop?

1083


What is polymorphism used for?

1053


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

3209


What is overriding vs overloading?

1049


is there any choice in opting subjects like 4 out of 7

2165


What is a function in oop?

1072


What do you mean by variable?

1020


Get me an image implementation program.

1971


What is class and object in oops?

1116


What is static modifier?

1194