N
NeilFang2008
Hello
Today, one of my friends said,"If you write a global operator new, you
will get a link error which complains new already defined in
msvcrt" (we are using MS VC++ 2005). I just said no, because C++
allows replacing global operator new. I have written a test, on static
lib with a global operator new, and an exe, and then all new linked to
my operator new. But he ask me, your operator new and the one defined
in msvcrt is just same function, how linker knows which to link? I can
not answer, anybody can tell me? Thanks a lot!
Today, one of my friends said,"If you write a global operator new, you
will get a link error which complains new already defined in
msvcrt" (we are using MS VC++ 2005). I just said no, because C++
allows replacing global operator new. I have written a test, on static
lib with a global operator new, and an exe, and then all new linked to
my operator new. But he ask me, your operator new and the one defined
in msvcrt is just same function, how linker knows which to link? I can
not answer, anybody can tell me? Thanks a lot!