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

Is there a sort function in c++?

1053


How are the features of c++ different from c?

1167


How do I run a program in notepad ++?

1170


True or false, if you keep incrementing a variable, it will become negative a) True b) False c) It depends

2438


What is the difference between global int and static int declaration?

1152


What is runtime polymorphism in c++?

1226


What are the advantage of using register variables?

1208


What is purpose of abstract class?

1127


What is buffering in c++?

1103


What is the two main roles of operating system?

1124


What is the exit function in c++?

1027


Is c++ pass by reference or value?

1123


What is the size of a vector?

1193


What new()is different from malloc()?

1162


what is COPY CONSTRUCTOR and what is it used for?

1127