Explain the difference between 'operator new' and the 'new'
operator?
Answer Posted / richa
The term "operator new" is used incase when u are
overloading the global "new" operator.We can overload ne
operator just as any other operators i.e +,-,*,=etc.
The term "new operator" is used in case of dynamic
allocation of memory.When a variable is allocated memory
dynamically the new operator is used.
Eg:
int *p=new int;
//here p is pointer to integer.So in order to allocate
memory for it we have used the new operator.
| Is This Answer Correct ? | 15 Yes | 0 No |
Post New Answer View All Answers
What is struct c++?
What is the use of endl?
How do you establish an is-a relationship?
Is java a c++?
How to access a variable of the structure?
What is a c++ vector?
Define pure virtual function?
Will the following program execute?
What is the default width for ouputting a long integer using the insertion operator?
Describe delete operator?
Can I have a reference as a data member of a class? If yes, then how do I initialise it?
Who made c++?
Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement
What does it mean to declare a member variable as static?
What do the keywords volatile and mean mutable?