请哪位帮忙解一下惑?
bool List::GetElem(int i, Node* pNode)
{
if (i < 0 || i >= m_iLength)
{
return false;
}
Node* currentNode = m_pList;
Node* currentNodeBefore = NULL;(这个代码多余的)???
for (int k = 0; k <= i; k++)
{
currentNodeBefore = currentNode;(这个代码多余的)???
currentNode = currentNode->next;
}
pNode->data = currentNode->data;
return true;