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

前端 未结 15 2715
春和景丽
春和景丽 2020-11-21 23:53

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

Related (duplicate?): In what cases do I use malloc vs

15条回答
  •  太阳男子
    2020-11-22 00:18

    1.new syntex is simpler than malloc()

    2.new/delete is a operator where malloc()/free() is a function.

    3.new/delete execute faster than malloc()/free() because new assemly code directly pasted by the compiler.

    4.we can change new/delete meaning in program with the help of operator overlading.

提交回复
热议问题