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 |
1.Between 100 and 999 are some numbers that have the characteristics that if you cube the individual digits and sum together you will get the same number. 2. A program that can accept as input an integer and output the equivalent of that number in words.
What is pointer in c++ with example?
Why null pointer is used?
What is the difference between Class and Structure?
40 Answers HP, IBM, Samsung, TCS,
Difference between Operator overloading and Functional overloading?
When does the c++ compiler create temporary variables?
What is the use of static functions?
const char * char * const What is the differnce between the above two?
State two differences between C and C++.
State the difference between delete and delete[].
What is Object Oriented programming.what is the difference between C++ and C?
Implement stack operations with pointers with appropriate exception checks.