删除指针内的指针的问题 [英] Issue with deleting pointer inside a pointer
本文介绍了删除指针内的指针的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下为此示例:
Below is the sample for that:
struct B
{
long Ids[20];
long Count;
};
typedef struct _A
{
int iId;
B *pB;
}A, *LA;
void Main()
{
A * ob = new A();
ob->pB= new B ();
delete ob->pB;
delete ob;
}
我来这里堆特定错误。上面的代码中是否有任何问题
Here I am getting Heap specific error. Is there any issue in the above code
推荐答案
以下为此示例:
...以上代码中是否有任何问题
Below is the sample for that:
... Is there any issue in the above code
不使用您显示的代码。您对该示例的调试显示了什么?
Not with the code you showed. What does your own debugging of that example show?
Dave
这篇关于删除指针内的指针的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文