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 C++ exceptional handling?
What does namespace mean in c++?
Why was c++ made?
write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)
What is a c++ object?
What is a volatile variable in c++?
What is friend class in c++ with example?
Search for: what is pair in c++?
Which is most difficult programming language?
Which format specifier is used for printing a pointer value?
What are the differences between the function prototype and the function defi-nition?
What is the array and initializing arrays in c++?
What is runtime polymorphism in c++?
What do you mean by volatile and mutable keywords used in c++?
What is c++ mutable?