// Class Example and Exercise. #include #include // to define NULL using namespace std; class L{ // A dumb singly linked list class. // In general do not make everything public like this public: L(char c){chr=c; nxt=NULL;} char chr; // the data in the node L* nxt; // pointer to the next node (if any) };// class L main() { L* h; // h is for the head of the list. //Construct a list, step by step. h = new L('a'); // h points at a newly constructed node h->nxt = new L('b'); // the nxt field of h points at a second node h->nxt->nxt = new L('c'); // plug in the third node. //Show what we have done. cout << h->chr << h->nxt->chr << h->nxt->nxt->chr; return 0; }