new delete 的问题
typedef struct QNode{
CString data;
struct QNode* next;
}QNode;
typedef struct QList
{
struct QNode* front;
struct QNode* end;
}QList;
void InsertQL(QList* QL,CString value)
{
CString m;
QNode* p;
p=new(QNode);
m=value;
p->data=m;
if(QL->front==NULL)
{
QL->front=p;
QL->end=p;
p->next=NULL;
}
else
{
p->next=NULL;
QL->end->next=p;
QL->end=p;
}
delete[] p;
}
为什么delete的时候会出错呢