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

Why pointer is used in c++?

617


Differentiate between an array and a list?

709


What are separators in c++?

624


What is the difference between an external iterator and an internal iterator? Describe an advantage of the external iterator.

564


What do you mean by function pointer?

597






Is java easier than c++?

591


Why is c++ so fast?

531


Write about all the implicit member functions of a class?

600


What is the array and initializing arrays in c++?

508


How is static data member similar to a global variable?

584


What does new do in c++?

637


In a function declaration, what does extern mean?

638


Is it possible to use a new for the reallocation of pointers ?

601


Why is c++ awesome?

578


What is virtual destructor? What is its use?

579