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

why the memory allocated with new cant be freed using free()

Answer Posted / durgalakshmi

new keyword does two things.
1) allocate memory using new operator
2) invokes the constructor.

so the allocated memory using new should be freed only by
delete which frees the memory by calling the destructor.

But free will not do these things.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does enum stand for?

1187


What causes polymorphism?

1184


What is encapsulation and abstraction? How are they implemented in C++?

1188


What are the 3 pillars of oop?

1245


What are properties in oop?

1144


class type to basic type conversion

2470


What is object in oop with example?

1304


design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

6731


Please send ford technologies placement paper 2 my mail id

2148


How do you explain polymorphism?

1115


Is this job good for future? can do this job post grduate student?

2220


Why do we use class in oops?

1021


write knight tour problem which is present in datastructure

2716


Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

2204


What are oops methods?

1075