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 |
Under what conditions is multiple inheritance not recommended?
Is c++ low level?
What are libraries in c++?
Evaulate: 22%5 a) 2 b) 4 c) 0
What is the first name of c++?
Explain what is oop?
What is enum class in c++?
Difference between Top down and bottom up approaches for a given project ?
14 Answers BSNL, CSC, HCL, HP, IIT, Infosys, Siemens,
How would you use the functions randomize() and random()?
Tell me difference between constant pointer and pointer to a constant.
What is split a string in c++?
what is the size of a class which contains no member variables but has two objects??? is it 1 or 2??