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


Please Help Members By Posting Answers For Below Questions

What is the last index number in an array of 100 characters a) 100 b) 99 c) 101

592


Implement stack operations with pointers with appropriate exception checks.

569


What is helper in c++?

576


How do you add an element to a set in c++?

553


Why do we need runtime polymorphism in c++?

561






How would you call C functions from C++ and vice versa?

640


what are the events occur in intr activated on interrupt vector table

1182


What is iterator in c++?

621


How much do coding jobs pay?

555


What is conditions when using boolean operators?

607


What is the best book for c++ beginners?

579


Is string an object in c++?

661


Why is c++ so fast?

531


What are the various operations performed on stack?

631


How many keywords are used in c++?

560