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

Is react oop?

1112


What is object in oop?

1173


What is protected in oop?

1120


What is the oops and benefits of oops programming?

1034


What is object-oriented programming? Webopedia definition

1343


what are the realtime excercises in C++?

2898


What is the difference between static polymorphism and dynamic polymorphism?

1138


What is encapsulation example?

1129


What does I oop mean?

1132


What is an example of genetic polymorphism?

1244


What is oops with example?

1104


hi all..i want to know oops concepts clearly can any1 explain??

2179


What is difference between data abstraction and encapsulation?

1130


What is advantage of inheritance?

1228


How oops is better than procedural?

1152