What is the difference between new() and malloc()?

Answer Posted / nashiinformaticssolutions

o new initializes the object and calls its constructor.
o malloc allocates memory but does not call constructors.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does c++ support multilevel and multiple inheritances?

740


What do you mean by persistent and non persistent objects?

1050


What is a multimap c++?

862


Explain static and dynamic memory allocation with an example each.

845


Difference between pointer to constant and constant pointer to a constant. Give example.

857


What do you mean by function overriding & function overloading in c++?

799


Why do we need constructors in c++?

842


What are the two types of polymorphism?

782


Explain "const" reference arguments in function?

807


What is the difference between a "copy constructor" and an "assignment operator" in C++?

832


Explain bubble sorting.

817


What is setw manipulator in c++?

802


Why is polymorphism useful?

799


What is struct c++?

746


Can turbo c++ run c program?

826