I recently attended a interview where I was asked something in the line of what the memory allocated by new or malloc looks like. My answer to it was that that would really depend on the compiler, which led us to the question that what if I am linking together two object codes compiled using different compilers and there is some object allocated in one of the .o (it could even be a library) s a reference/pointer to which is passed to some function in the other .o (or whatever it is), which in turn is resposible for deleting the memory allocated for the object.

now, if the implementation of new and delete varied from compiler to compiler that would not be possible.

Can someone throw some light on the reality of this. Was I right in what I said at the interview?

Regards
I