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