求大神, c++的问题
void List::ClearList()
{
Node *currentNode = m_pList;
while (currentNode->next != NULL) // 未释放的指针是危险的
{
Node *temp = currentNode->next;
delete currentNode;
currentNode = temp;
}
m_pList->next = NULL;
}
感觉 p_list->data的数据没有被清除啊, 这样没影响吗
void List::ClearList()
{
Node *currentNode = m_pList;
while (currentNode->next != NULL) // 未释放的指针是危险的
{
Node *temp = currentNode->next;
delete currentNode;
currentNode = temp;
}
m_pList->next = NULL;
}
感觉 p_list->data的数据没有被清除啊, 这样没影响吗
2017-03-31
举报