2011年4月1日

C++动态数组分配

摘要: 动态一维数组:#include<iostream>using namespace std;int main(){ int len; cin>>len; int *p=new int[len]; delete[] p; p = NULL; return 0;}动态二维数组:int main(){ int row, col; cout << "Please enter the number for row and column: " << endl; cin >> row >>col; //为二维数组开辟空 阅读全文

posted @ 2011-04-01 15:06 Livid 阅读(338) 评论(0) 推荐(0) 编辑

内存泄漏检测工具(转载)

摘要: 内存泄漏检测工具2007年08月08日1. ccmalloc-Linux和Solaris下对C和C++程序的简单的使用内存泄漏和malloc调试库。 2. Dmalloc-Debug Malloc Library. 3. Electric Fence-Linux分发版中由Bruce Perens编写的malloc()调试库。 4. Leaky-Linux下检测内存泄漏的程序。 5. LeakTracer-Linux、Solaris和HP-UX下跟踪和分析C++程序中的内存泄漏。 6. MEMWATCH-由Johan Lindh编写,是一个开放源代码C语言内存错误检测工具,主要是通过gcc的pr 阅读全文

posted @ 2011-04-01 11:39 Livid 阅读(255) 评论(0) 推荐(0) 编辑

导航