why the memory allocated with new cant be freed using free()
Answer Posted / bharti
Because with new operator in C++ delete operator is used to
deallocate the memory. And with malloc() free() is used. S
it may not be supported by some of the compilers to free
memory with free() created by new.
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
• What are the desirable attributes for memory managment?
What is encapsulation example?
Why is it so that we can have virtual constructors but we cannot have virtual destructors?
Explain virtual inheritance?
What is polymorphism in oops?
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
What is class and object in oops?
How do you achieve polymorphism?
What is abstraction in oops?
what type of question are asked in thoughtworks pair programming round ?
What is the difference between a constructor and a destructor?
What type of loop is a for loop?
What does I oop mean?
What is the significance of classes in oop?
Why is encapsulation used?