目录
1.VS安装内存泄漏检测工具VLD
参考这篇博客即可:https://blog.csdn.net/GZrhaunt/article/details/56839765
2.C语言下实现二维数组的动态开辟
#include<iostream>
#include<assert.h>
#include<vld.h>
using namespace std;
#define Type int
#define ROW 3
#define COL 4
Type** _Malloc(int row, int col)
{
Type **p = (Type**)malloc(sizeof(Type*)*row);
for (int i = 0; i < row; i++)
p[i] = (int*)malloc(sizeof(int)*COL);
return p;
}
void _Assign(Type **p, int row, int col)
{
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
p[i][j] = i + j;
}
}
}
void _Print(Type **p, int row, int col)
{
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
printf("%d", p[i][j]