相关疑难解决方法(0)

new,delete,malloc&free

我在接受采访时问过这个问题:

在C++中,

  1. 如果我们分配内存malloc并使用它delete来释放分配的内存怎么办?
  2. 如果我们使用new并使用它来释放内存free怎么办?

如果在代码中使用上述内容,我们将面临哪些问题?

我的回答是没有区别.这样说我是对的吗?

c++ malloc free memory-management new-operator

13
推荐指数
1
解决办法
4962
查看次数

标签 统计

c++ ×1

free ×1

malloc ×1

memory-management ×1

new-operator ×1