What is the difference between new() and malloc()?
Answers were Sorted based on User's Feedback
Answer / nashiinformaticssolutions
• new: Calls constructor, returns an object of the correct type.
• malloc(): Does not call constructor, returns void*.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nashiinformaticssolutions
o new initializes the object and calls its constructor.
o malloc allocates memory but does not call constructors.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / glibwaresoftsolutions
• new: Calls constructor, returns an object of the correct type.
• malloc(): Does not call constructor, returns void*.
| Is This Answer Correct ? | 0 Yes | 0 No |
• new: Calls constructor, returns an object of the correct type.
• malloc(): Does not call constructor, returns void*.
| Is This Answer Correct ? | 0 Yes | 0 No |
How do you remove an element from a set in c++?
How is data hiding achieved in c++?
When should we use multiple inheritance?
What is c++ mutable?
Why is c++ awesome?
What is the difference between stack and heap memory?
Explain the use of virtual destructor?
What is a node class?
Is eclipse good for c++?
Differentiate between structure and class in c++.
Explain about templates of C++.
Differentiate between a constructor and a destructor in c++.