Explain the difference between 'operator new' and the 'new'
operator?
Answer / 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 |
How to avoid changing constant values?
Explain the difference between c & c++?
What is constructor c++?
What are different types of loops in c++?
What is virtual base class uses?
Define 'std'.
What are shallow and deep copies?
Why do we need runtime polymorphism in c++?
How do I run c++?
What is math h in c++?
What is static in c++?
What causes a runtime error c++?