What is the difference between creating an object,
using 'new' and using 'malloc'?

Answer Posted / guna

malloc
1) can't initialize the memory
2)type casting is required
3)malloc is a function.
4)can't be overloaded.
new
1) memory can be initialized
2)no type casting for operator
3)new is an operator
4)can be overloaded.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Plese get me a perfect C++ program for railway/airway reservation with all details.

3431


What are destructors?

577


What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0

583


Explain virtual destructor?

676


What is oops and its features?

592






Explain polymorphism?

586


Carry out conversion of one object of user-defined type to another?

616


What is lambda expression c++?

578


Explain method of creating object in C++ ?

597


what is the sylabus for priliminaries?

1691


Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. Your program should work for squares of all side sizes between 1 and 20. --- │ │ │ │ │ │ ---

1653


What are the advantages of using friend classes?

631


What is use of overloading?

610


Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).

636


Explain what is oop?

619