- c语言中:
- 动态分配内存: malloc()函数;
- 释放内存: free()函数;
- c++中:
- 上述函数仍然可以使用;
- 动态分配内存: new关键字;
- 释放内存: delete关键字;
int *p = new int;
delete p;
int *p = new int[10];
delete[] p;
原创文章,作者:,如若转载,请注明出处:https://blog.ytso.com/273420.html
int *p = new int;
delete p;
int *p = new int[10];
delete[] p;
原创文章,作者:,如若转载,请注明出处:https://blog.ytso.com/273420.html