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
What is a down cast?
What are the 5 oop principles?
Who invented turbo c++?
Can you inherit a private class?
What is the advantage of an external iterator.
How to declaring variables in c++?
Can member functions be private?
Describe new operator?
. If employee B is the boss of A and C is the boss of B and D is the boss of C and E is the boss of D. Then write a program using the Database such that if an employee name is Asked to Display it also display his bosses with his name. For eg. If C is displayed it should also display D and E with C?
What is c++ coding?
What is buffer and example?
Write a program to find the Factorial of a number
What is the this pointer?
what is Loop function? What are different types of Loops?
What are the two types of polymorphism?