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 the last index number in an array of 100 characters a) 100 b) 99 c) 101
Implement stack operations with pointers with appropriate exception checks.
What is helper in c++?
How do you add an element to a set in c++?
Why do we need runtime polymorphism in c++?
How would you call C functions from C++ and vice versa?
what are the events occur in intr activated on interrupt vector table
What is iterator in c++?
How much do coding jobs pay?
What is conditions when using boolean operators?
What is the best book for c++ beginners?
Is string an object in c++?
Why is c++ so fast?
What are the various operations performed on stack?
How many keywords are used in c++?