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

Shall we use 'free' to free memory assigned by new, What are
the further consequences??

Answer Posted / krishnarao panchadi

Syntactically we can use "free" in place of "delete". But
semantically it is senseless as it wont call the destructor.

Note that, deallocating is not the only purpose of
using "delete". The destructor should also be called if you
call the constructor(while creating the object).
Failing to call "delete" may lead to system crash.

Using "free" wont call the desturctor.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can malloc be used in c++?

1065


Is c++ pass by reference or value?

1045


What is the full form of dos?

1138


Why do we use using namespace std in c++?

1061


Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

980


What does asterisk mean in c++?

1104


Can we sort map in c++?

1011


Explain the advantages of using friend classes.

1144


What is c++ manipulator?

973


Can we define function inside main in c++?

995


Tell me can a pure virtual function have an implementation?

1015


How can I learn dev c++ programming?

1032


Describe new operator?

1144


What is an orthogonal base class in c++?

1152


Can non graphic characters be used and processed in C++?

1188