#include using namespace std; template class Node { public: T value; // e.g. int Node* next; // pointer to the next element in the list Node* prev; }; int main() { Node* ll; // ll is a pointer to a Node (initially non-existent) ll = new Node; // Create a Node ll->value = 1; // (*ll).value = 1; ll->next = 0; // a null pointer (end of list) // This is push_back(): Node* q = new Node; q->value = 2; q->next = 0; ll->next = q; // Link them together cout << "First value: " << ll->value << '\n'; cout << "Second value: " << q->value << '\n'; cout << "Second value: " << ll->next->value << '\n'; q->next = ll; // create a circular linked list return 0; }