why the memory allocated with new cant be freed using free()
Answer Posted / durgalakshmi
new keyword does two things.
1) allocate memory using new operator
2) invokes the constructor.
so the allocated memory using new should be freed only by
delete which frees the memory by calling the destructor.
But free will not do these things.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What does enum stand for?
What causes polymorphism?
What is encapsulation and abstraction? How are they implemented in C++?
What are the 3 pillars of oop?
What are properties in oop?
class type to basic type conversion
What is object in oop with example?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
Please send ford technologies placement paper 2 my mail id
How do you explain polymorphism?
Is this job good for future? can do this job post grduate student?
Why do we use class in oops?
write knight tour problem which is present in datastructure
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer
What are oops methods?