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...


Can we declare destructor as static? Explain?

Answers were Sorted based on User's Feedback



Can we declare destructor as static? Explain?..

Answer / murali

Yes we can. But you can't use it.

Use new to create the object.
At the same time you can't use delete.

Why can't : As destuctor uses 'this' context and in this
case it can't being static.

Is This Answer Correct ?    8 Yes 2 No

Can we declare destructor as static? Explain?..

Answer / jaroosh

To sum up : you CANT declare destructor as static, as you
CANT declare constructor as static, both are responsible for
destroying and creating OBJECTS while static storage means
that methods/members do not belong to any objects but to the
whole class.

Is This Answer Correct ?    7 Yes 1 No

Can we declare destructor as static? Explain?..

Answer / sunil

declaring destructor and constructor as static is a syntax error

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C++ General Interview Questions

What is different in C++, compare with unix?

0 Answers  


Disadvantages of c++

8 Answers   HCL,


What is algorithm in c++ programming?

0 Answers  


What is c++ map?

0 Answers  


Why do we use structure in c++?

0 Answers  


Is c++ vector a linked list?

0 Answers  


Can we use this pointer in a class specific, operator-overloading function for new operator?

0 Answers  


Is c++ vector dynamic?

0 Answers  


Should the member functions which are made public in the base class be hidden?

0 Answers  


What is dynamic and static typing?

0 Answers  


What is c++ coding?

0 Answers  


how to swap two strings without using any third variable ?

11 Answers  


Categories