Answer Posted / prakruthi
new automatically calls the constructor while malloc()
dosen't., also new being an operator, it can be overloaded.
since malloc returns a void pointer it is necessary to
explicitly typecast it into an appropriate type of pointer.
This gets completely avoided when we are using new operator.
| Is This Answer Correct ? | 25 Yes | 2 No |
Post New Answer View All Answers
Why polymorphism is used in oops?
What are the advantages of polymorphism?
How to improve object oriented design skills?
What is overloading in oops?
What is encapsulation in oop?
How is polymorphism achieved?
Templates mean
What are the components of marker interface?
What are objects in oop?
What are the important components of cohesion?
What is overriding in oop?
What is polymorphism programming?
Which method cannot be overridden?
How to use CMutex, CSemaphore in VC++ MFC
#include