What is the difference between new/delete and malloc/free?

Answer Posted / neelam saini

Malloc/free do not know about constructors and destructors. New and delete create and destroy objects, while malloc and free allocate and deallocate memory.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to allocate memory dynamically for a reference?

623


What is meant by a delegate?

715


What is meant by entry controlled loop?

742


Difference between pointer to constant vs. Pointer constant

700


Can you sort a set c++?

624






What is main function in c++ with example?

651


What is std namespace in c++?

807


write a c++ program to create class student having datamember name,Roll_no,age,and branch intilcization all the member using constructor print the all the details on the screen.

2339


Explain what is oop?

706


What is the importance of mutable keyword?

683


What is a type library?

781


What is the most common mistake on c++ and oo projects?

601


Do the names of parameters have to agree in the prototype, definition, and call to the function?

690


What is linked list in c++?

783


explain the reference variable in c++?

683