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

What do c++ programmers do?

653


What are the differences between new and malloc?

716


Which language is pure oop?

638


What is data binding in oops?

697


Explain selection sorting. Also write an example.

680






Difference between a homogeneous and a heterogeneous container

762


State two differences between C and C++.

705


What is a hashmap c++?

650


What is a constructor in c++ with example?

670


Explain Memory Allocation in C/C++ ?

715


Does c++ cost money?

675


Define basic type of variable used for a different condition in C++?

757


What is array in c++ example?

746


What is a far pointer? where we use it?

703


What is a .h file c++?

610