关于这里指针的使用有一件事我不明白Cell *curr = head;
这里需要地址,head
它用它做什么?
Cell *ConvertToListIter(Vector<int>& vector)
{
Cell *head = new Cell;
head->next = NULL;
head->value = vector[0];
Cell *curr = head;
for (int i = 1; i < vector.size(); i++) {
Cell *newCell = new Cell;
newCell->next = NULL;
newCell->value = vector[i];
curr->next = newCell;
newCell = curr;
}
return head;
}