New vs opeator new

A common interview question: Explain the difference between new and operator new.

I have googled, but could not find any real satisfying explanations. Can somebody explain the difference to me? And which one of these two can be overloaded, and when would you need to do that? Thanks!
It doesn't make much sense. "new" and "operator new" are the same thing.
http://en.wikipedia.org/wiki/New_%28C%2B%2B%29
http://cplusplus.com/reference/std/new/operator%20new/

I think by "operator new" he means the form of new that doesn't call the ctor:

-) operator new - allocates memory, doesn't call ctor
-) placement new - doesn't allocate memory, calls ctor
-) new - allocates memory, calls ctor
new always calls constructors.
Oh, so that's how the STL does it.
@jsmith:

From the page on this site:

1
2
3
4
   myclass * p3 = (myclass*) operator new (sizeof(myclass));
// (!) not the same as:
// myclass * p3 = new myclass;
// (constructor not called by function call, even for non-POD types) 
The "new" keyword in C++ calls operator new() first, then calls the constructor for every object allocated.

operator new() is more or less equivalent to malloc() (in operation! Don't mix calls to new and malloc() with delete and free()).

Nice link Disch.

Hope this helps.
Mixing new/delete and malloc/free is generally a bad idea.
Topic archived. No new replies allowed.