// Class Example and Exercise. #include #include // to define NULL using namespace std; class S{ // another dumb singly linked list class // here the pointers point back to earlier items. // Te effect is rather like a S????. public: S(char c, S* p){chr=c; prev=p;} // must state char chr; S* prev; // pointer to previous item. };// class S main() { S* t; // t is for top or perhaps tail! // put things onto the list t = new S('a', NULL); t = new S('b', t); t = new S('c', t); t = new S('d', t); // printout what is in the list cout << t->chr << t->prev->chr << t->prev->prev->chr << t->prev->prev->prev->chr << endl; return 0; }