the difference between new and malloc

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


Please Help Members By Posting Answers For Below Questions

What is polymorphism explain?

1015


What is coupling in oop?

805


What is abstraction in oops with example?

1038


Why is oop useful?

844


How do you define social class?

850


Advantage and disadvantage of routing in telecom sector

1064


What is polymorphism used for?

805


Why multiple inheritance is not allowed?

864


Which language is not a true object oriented programming language?

908


Templates mean

1866


how to get the oracle certification? send me the answer

1932


What is abstract class in oops?

808


What is the difference between a mixin and inheritance?

776


hi all..i want to know oops concepts clearly can any1 explain??

1920


What is overloading and its types?

864