2018年9月22日

C/C++ - malloc/free和new/delete的区分

摘要: new/delete与malloc/free的区别主要表现在以下几个方面: 注意:最主要的区别,new/delete是运算符,而malloc/free是函数 (1)、new能够自动计算需要分配的内存空间,而malloc需要手工计算字节数。 例如,int* p1=new int[2] , int* p 阅读全文

posted @ 2018-09-22 15:07 kukou 阅读(129) 评论(0) 推荐(0) 编辑

导航