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
What is a flag in c++?
What is the oldest programming language?
Which should be more useful: the protected and public virtuals?
What is difference between c++ and c ++ 14?
How to declare a function pointer?
How static variables and local variablesare similar and dissimilar?
What do you understand by zombie objects in c++?
What is void pointer in c++ with example?
Is java easier than c++?
What is the full form nasa?
What is the use of 'using' declaration in c++?
What is the best free c++ compiler for windows?
In a function declaration what does extern means?
Explain the isa and hasa class relationships.
Why is c++ a mid-level programming language?