Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the difference between new operator and operator new?

difference operator
0
Posted

What is the difference between new operator and operator new?

0

The “new” operator allocates a new instance of an object from the heap, utilizing the most appropriate constructor for the arguments passed. Like many operators in C++, the “new” operator for a particular class can be overridden, 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.

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123