相关疑难解决方法(0)

有一个很好的Valgrind替代Windows吗?

当我发现它仅适用于Linux时,我正在研究Valgrind以帮助改进我的C编码/调试 - 我没有其他需要或兴趣将我的操作系统转移到Linux所以我想知道是否有一个同样好的Windows程序.

c windows debugging valgrind memory-leaks

210
推荐指数
12
解决办法
30万
查看次数

删除指针的问题(指向的内容)

如何删除我在下面的代码中指定的指针:

char* ptr;
ptr=new char(65);   // memory for one char is created and is assigned 'A'
strcpy(ptr,"asdf"); // how can string of length 4 chars are copied
delete ptr;         // why am I getting debug error of Heap corruption detected
Run Code Online (Sandbox Code Playgroud)

我正在使用Visual C++ 2005

c++ delete-operator

1
推荐指数
1
解决办法
197
查看次数

标签 统计

c ×1

c++ ×1

debugging ×1

delete-operator ×1

memory-leaks ×1

valgrind ×1

windows ×1