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

Describe new operator and delete operator?

622


What is a static member?

606


What is a list c++?

568


If you push the numbers (in order) 1, 3, and 5 onto a stack, which pops out first a) 1 b) 5 c) 3

830


Write a recursive program to calculate factorial in c++.

605






What is a lambda function c++?

548


What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?

668


class type to basic type conversion

1833


What is a hashmap c++?

564


What is a standard template library (stl)? What are the various types of stl containers?

667


Can a built-in function be recursive?

580


What is inheritance in simple words?

622


What is flush () in c++?

578


how to connect with oracle 9i with server in socket program in c/c++

1845


How can you link a c++ program to c functions?

617