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 / nishikant sahu

Yes you can but not recommend, b'c some time when you class
hold the heap memory it can't be free by "Free" b'c of no
constructor call happening via "Free" and you get the memory
leak. so use New/ delete or malloc/free pair.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c++ flowchart?

1343


Define virtual constructor.

1072


Why is polymorphism useful?

1036


How to declaring variables in c++?

1123


What is function overloading c++?

1036


Why should you learn c++?

985


What are the advantages of using a pointer?

1040


Explain abstraction.

1061


Differentiate between an inspector and a mutator ?

1169


How would you use the functions sin(), pow(), sqrt()?

1149


What is a modifier in c++?

1103


What do c++ programmers do?

1023


I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.

1096


What are maps in c++?

915


Do inline functions improve performance?

1025