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 flush a buffer in c++?
Explain Memory Allocation in C/C++ ?
Is java the same as c++?
Differentiate between structure and class in c++.
What kind of jobs can I get with c++?
Write a C++ Program to Multiply two Numbers
Differentiate between declaration and definition.
What is private inheritance?
What does #define mean in c++?
Name four predefined macros.
Difference between shift left and shift right?
What is a memory leak c++?