📜  如何在 C++ 代码示例中遍历链表

📅  最后修改于: 2022-03-11 14:44:47.600000             🧑  作者: Mango

代码示例1
//make sure you have access to the first node in the list 
for (Node *ptr = first; ptr != nullptr; ptr = ptr->next) {
    cout << ptr->data << " ";
  }