#include using namespace std; class ListElement { public: int value; ListElement *next; }; int main() { ListElement *ptr, *head; int i; head = new ListElement; for(i=0, ptr = head; i < 4; i++, ptr = ptr->next) { ptr->value = i; ptr->next = new ListElement; } ptr->value = 4; ptr->next = NULL; for(ptr = head; ptr; ptr = ptr->next) cout<value<