:icon_question: how can we display the elements of a linked list?

How appropriately vague. Well, assuming quite a few things about the list because you didn't specify, the common convention is this:

for ( node *it = head; it != 0; it = it->next )
  std::cout<< it->data <<'\n';
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.