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 a singleton c++?

1009


Define private, protected and public access control.

1123


What is null pointer and void pointer?

1083


Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?

1266


What is the average salary of a c++ programmer?

1023


What are the uses of static class data?

1187


Explain the problem with overriding functions

1164


What is array in c++ example?

1118


Who calls main function?

1119


What do you mean by stack unwinding in c++?

1234


Define linked lists with the help of an example.

1030


Is java a c++?

1053


Why is c++ still popular?

1055


What is a friend function in c++?

1648


What is the best c++ ide?

1178