Question PRG-CPP-0052
MediumWhat is the difference between new/delete and malloc/free in C++?
- A.
delete does not free memory
- B.
malloc is type-safe
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
C++ question
What is the difference between new/delete and malloc/free in C++?
delete does not free memory
malloc is type-safe
Sign up free to see the answer and a step-by-step explanation.
new calls constructors and delete calls destructors; malloc/free only manage raw memory
They are identical