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?

590


What is methods in oop?

555


Why polymorphism is used in oops?

589


What is destructor oops?

625


Is this job good for future? can do this job post grduate student?

1694






Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

1625


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

1397


Can you explain polymorphism?

585


What is polymorphism used for?

577


What is encapsulation with example?

583


What is advantage of inheritance?

694


What is the advantage of oop over procedural language?

630


What is this pointer in oop?

557


write string class as your own class in java without using any built-in function

1982


What type of loop is a for loop?

688