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 the endl and setw manipulator works?
What is microsoft c++ redistributable?
Differentiate between late binding and early binding. What are the advantages of early binding?
What is searching? Explain linear and binary search.
Why is "using namespace std;" considered bad practice?
What is a dangling pointer in c++?
How does code-bloating occur in c++?
How much do c++ programmers make?
What is the use of 'using' declaration in c++?
If there are two catch statements, one for base and one for derived, which should come first?
What is scope operator in c++?
Can a Structure contain a Pointer to itself?
What is the protected keyword used for?
Is rust better than c++?
Explain the register storage classes in c++.