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 |
what are Access specifiers in C++ class? What are the types?
What are iterators in c++?
How would you represent an error detected during constructor of an object?
Explain the use of this pointer?
What's the order in which the objects in an array are destructed?
What is exception handling? Does c++ support exception handling?
What is the first name of c++?
What is a multiset c++?
Which should be more useful: the protected and public virtuals?
Can we inherit constructor in c++?
How to tokenize a string in c++?
How do I make turbo c++ full screen?