No discussion yet
Be the first to start the discussion.
Select Answer
new allocates memory and calls the constructor
new
new allocates on the stack; malloc on the heap
malloc
if memory allocation failed, new returns nullptr while malloc throws an error
nullptr
No difference