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
State the difference between delete and delete[].
Explain bubble sorting.
What is late binding c++?
Can we distribute function templates and class templates in object libraries?
How does a copy constructor differs from an overloaded assignment operator?
What is ios :: in in c++?
Why is c++ a mid-level programming language?
What is recursion?
What is the type of this pointer in c++?
How to implement is-a and has-a class relationships?
Is c++ an integer?
What is the full form of ios?
Explain class invariant.
What is class and structure in c++?
What problems might the following macro bring to the application?