Explain the difference between 'operator new' and the 'new'
operator?



Explain the difference between 'operator new' and the 'new' operator?..

Answer / 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

More C++ General Interview Questions

What is singleton pattern in c++?

0 Answers  


why can't we declare data member of class auto register or extern

1 Answers  


What is c++ good for?

0 Answers  


What kind of jobs can I get with c++?

0 Answers  


Which header file allows file i/o with streams a) fileio.h b) iostream.h c) fstream.h

0 Answers  






write asingle linked list which read from two list & the do the following 1 sort the prime & nonprime num (prime should be less tn nonprime) 2 each node has a prime num followd by nonprime 3 add a new node into its sutable plce 4 erase the most three duplicated non prime num 5 find the least duplicated prime num

0 Answers   Care,


How much do c++ programmers make?

0 Answers  


Describe delete operator?

0 Answers  


If I is an integer variable, which is faster ++i or i++?

0 Answers  


How many types of scopes are there in c++?

0 Answers  


What are smart pointer? Whats its use?

1 Answers   CTS,


Is there a new/delete equivalent of realloc?

1 Answers  


Categories