Difference between new operator and operator new

Answer Posted / skybeaver

The "new" operator allocates a new instance of an object
from the heap, utilising the most appropriate constructor
for the arguments passed.

Like many operators in C++, the "new" operator for a
particular class can be overriden, although there is rarely
a need to do so. "operator new" is the mechanism for
overriding the default heap allocation logic. Ask your
interviewer to provide you with a concrete example of when
he or she has been required to do this.

Is This Answer Correct ?    14 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can enum be null?

581


How Do you Code Composition and Aggregation in C++ ?

24185


why reinterpret cast is considered dangerous?

1894


Why do we use class in oops?

549


What causes polymorphism?

563






What are the 5 oop principles?

594


Can private class be inherited?

613


What is difference between abstraction and encapsulation?

584


What is abstraction and encapsulation?

564


Why interface is used?

547


What are the 3 pillars of oop?

607


What is the important feature of inheritance?

628


just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.

6480


What are the benefits of interface?

571


What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

1646