首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

_CrtIsValidHeapPointer的有关问题

2012-02-27 
_CrtIsValidHeapPointer的问题源代码的一部分:Error_code Extended_queue::serve_and_retrieve(Queue_entr

_CrtIsValidHeapPointer的问题
源代码的一部分:
Error_code Extended_queue::serve_and_retrieve(Queue_entry &queue_item)
{
if(front == NULL)
return underflow;
Node *old_front = front;
queue_item = old_front->entry;
front = old_front->next;
if(front == NULL)
rear = NULL;

  delete old_front;
//cout << "error";


return success;
}
把注释去掉,编译运行,不能输出error,而且弹出一个框说_CrtIsValidHeapPointer(pUserData),
放在delete语句上面就可以输出。请教一下。


[解决办法]
试图 释放无效指针
[解决办法]

热点排行