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
How should a contructor handle a failure?
What do you understand by a pure virtual member function?
What is the use of :: operator in c++?
Can you sort a set c++?
What is the c++ code?
What is a class template?
Describe new operator and delete operator?
Explain about Virtual Function in C++?
What is the full form of india?
Which operator cannot be overloaded c++?
What is bubble sort c++?
Define pointers?
What is linked list in c++?
Which is the best c++ compiler for beginners?
How do you clear a map in c++?