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

What is an incomplete type in c++?

1235


Name four predefined macros.

1009


Define whitespace in C++.

1162


What is the difference between structures and unions?

1031


What is the most powerful coding language?

1019


Is it possible for a member function to delete the pointer, named this?

1108


What is a container class? What are the types of container classes in c++?

1195


What is a null object in c++?

1175


Which c++ operator cannot overload?

961


What is c++ programming language?

1071


What's the best free c++ profiler for windows?

1043


How is computer programming useful in real life?

1028


How can I improve my c++ skills?

1082


What is a dynamic binding in c++?

926


How compile and run c++ program in turbo c++?

1136