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 are the unique features of C++.

574


Why is "using namespace std;" considered bad practice?

653


Can we define function inside main in c++?

555


What is the use of endl in c++?

593


What is low level language in simple words?

565






What is a string example?

549


How the programmer of a class should decide whether to declare member function or a friend function?

682


What is a hash function c++?

554


how to connect with oracle 9i with server in socket program in c/c++

1849


Write about all the implicit member functions of a class?

600


Explain the problem with overriding functions

609


What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required

575


Why is c++ not purely object oriented?

569


What is the basic difference between C and C++?

626


Distinguish between a # include and #define.

651