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 data type in c++?

970


Name the debugging methods that are used to solve problems?

1040


Is turbo c++ free?

1016


What is the disadvantage of using a macro?

1053


What is an operator in c++?

997


Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.

6345


Is python written in c or c++?

1094


What is a map in c++?

1103


What does h mean in maths?

1108


What is a static element?

1019


Explain all the C++ concepts using examples.

1155


What are dynamic type checking?

988


What is c++ flowchart?

1322


Write about the retrieval of n number of objects during the process of delete[]p?

976


What are the advantages of using a pointer? Define the operators that can be used with a pointer.

997