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 are the 3 levels of programming languages?
What is const pointer and const reference?
What is oops in c++?
Explain binary search.
How are Structure passing and returning implemented by the compiler?
Using a smart pointer can we iterate through a container?
Comment on c++ standard exceptions?
What is microsoft c++ redistributable?
What is command line arguments in C++? What are its uses? Where we have to use this?
Why main function is special in c++?
If all is successful, what should main return a) 0 b) 1 c) void
What is encapsulation in c++?
Explain polymorphism?
Differentiate between an array and a list?
What is virtual base class?