What is the difference between creating an object,
using 'new' and using 'malloc'?
Answer Posted / btech
new operator returns a pointer of the correct type and
malloc() returns a void*
New calls the object’s constructor and malloc does not.
Any object created with new must be freed using delete and
where as malloc() and free() allocates and deallocates
memory
new operator can be overloaded by a class, where as
malloc() can't be overloaded.
Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?
What is abstraction in c++ with example?
What are the rules about using an underscore in a c++ identifier?
What is abstraction example?
What is a local reference?
What are abstract data types in c++?
Explain explicit container.
Write a program to find the Fibonacci series recursively.
What do you mean by early binding?
Is it possible for a member function to delete the pointer, named this?
What is inheritance write a program to show use of inheritance?
Why is c++ called oops?
Describe new operator?
What are structs in c++?
Is c++ built on c?