求大神, c++的问题
bool List::ListInsertHead(Node *pNode)
{
Node *temp = m_pList;
Node *newNode = new Node;
if (new Node == NULL)
return false;
newNode->data = pNode->data;
m_pList->next = newNode;
newNode->next = temp;
}
不明白为什么要加newNode 直接接上不就行了
bool List::ListInsertHead(Node *pNode)
{
Node *temp = m_pList;
Node *newNode = new Node;
if (new Node == NULL)
return false;
newNode->data = pNode->data;
m_pList->next = newNode;
newNode->next = temp;
}
不明白为什么要加newNode 直接接上不就行了
2017-03-28
举报