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
When can I use a forward declaration?
What is searching?
Why ctype h is used in c++?
Where and why do I have to put the "template" and "typename" keywords?
What are abstract data types in c++?
What is the most common mistake on c++ and oo projects?
What is exception handling? Does c++ support exception handling?
What is virtual base class uses?
Which bitwise operator is used to check whether a particular bit is on or off?
What is &x in c++?
Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].
What is a syntax in c++?
What are the advantages of prototyping?
Is c++ a programming language?
What are the basic data types used in c++?