C++内存管理
来源:互联网 发布:视频监控客户端软件 编辑:程序博客网 时间:2024/04/29 18:20
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int *p= new int;
if(NULL==p)
{
system("pause");
return 0;
}
*p=20;
cout<<*p<<endl;
delete p;
p==NULL;
system("pause");
return 0;
}
//管理块内存
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int *p= new int[1000];
if(NULL==p)
{
system("pause");
return 0;
}
p[0]=10;
p[1]=20;
cout<<p[0]<<' '<<p[1]<<endl;
delete []p;
p==NULL;
system("pause");
return 0;
}
0 0
- C/C++ 内存管理
- C内存管理函数
- C内存管理
- C内存管理
- object c 内存管理
- C 内存管理详解
- C 内存管理
- C语言内存管理
- c/c++内存管理
- c 的内存管理
- C内存管理
- Ojbective-c 内存管理
- C内存管理
- objective-c内存管理
- Objective-c 内存管理
- Objective-C内存管理~~
- c,c++内存管理
- Objective-C内存管理
- 未处理的“System.BadImageFormatException”类型的异常
- 2016年度总结
- 画图板重构版本一
- POJ 1469 COURSES(HK算法)
- c++ list 遍历删除节点
- C++内存管理
- 视音频数据处理入门:RGB、YUV像素数据处理
- 为什么互联公司都用MySQL非oracle,难道只是便宜
- C++面试题(二)
- 推荐系统:技术、评估及高效算法 第9章
- ThinkPHP标签库
- YihAN_Z's 测试之——国王的烦恼
- 画图板重构二
- 删除Maven更新失败后遗留的.lastUpdate文件问题