What is the difference between new and malloc?
Answer:
See the following comparison chart for malloc and new (malloc vs new):
new
malloc
malloc()
void*
NULL
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Answer:
See the following comparison chart for malloc and new (malloc vs new):
newmallocnewis an operator that takes a type and (optionally) a set of initializers for that type as its arguments.malloc()is a library function that takes a number (of bytes) as its argument.void*pointing to uninitialized storage which is type unsafe.NULL