#inlcude<malloc.h>
malloc,free
new,delete
int *a;
C语言:
a=(int *)malloc(sizeof(int)*2);//相当于:a[2]
free(a);
C++语言:
a=new int[2];//相当于:a[2]
delete(a);
2248

被折叠的 条评论
为什么被折叠?