Question: What is the difference between new/delete and malloc/free?
Question:What is the difference between new/delete and malloc/free?
Answer: Malloc/free do not
know about constructors and destructors. New and delete create and destroy
objects, while malloc and free allocate and deallocate memory.
No comments:
Post a Comment