1

Possible Duplicate:
What is the difference between new/delete and malloc/free?

Can anyone please tell me the relation between the c++ operators like new/delete etc and the functions in libc i.e malloc/free. Though just tested it positive that a call to new/free actually lands up to malloc and free respectively. So that means libstdc++ inherently requires libc.

Community
  • 1
  • 1
Kapil
  • 836
  • 2
  • 8
  • 20
  • 2
    Whether or not `new` and `delete` result in calls to `malloc` or `free` is completely implementation defined, and not behavior you can rely on. On the implementation you tested, that seems to be what happens, but it doesn't have to, and with a different compiler or on a different platform, it may not. – Omnifarious Sep 21 '11 at 06:03

0 Answers0