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 is oops?what is its use in software engineering?

1015


What is constructor in oop?

1084


What are the data types in oop?

1086


What are objects in oop?

1078


c++ program to swap the objects of two different classes

2395


What makes a language oop?

1033


What is overriding in oop?

1028


What is the important feature of inheritance?

1111


What is and I oop mean?

1166


Where is pseudocode used?

1087


Write a program to reverse a string using recursive function?

2323


What are constructors in oop?

1150


Plese get me a perfect C++ program for railway/airway reservation with all details.

3877


How to use CMutex, CSemaphore in VC++ MFC

4769


What is difference between abstraction and encapsulation?

1064