|
This is a very basic implementation of a linked list in C++. This shows how a simple list structure can be created easily using a single C++ class. The class has the methods: insert, display and display reverse. It also uses a constructor to initialise the list. Each item in the list is a structure containing a string, a pointer to the next item in the list, and a pointer to the previous item in the list. You do not really need pointers pointing both ways, but it allows for easier traversal in either direction. Please feel free to copy this code and adapt it for your own uses, but to get it to do anything very useful you'll probably need to add a few more methods. If you have any questions about how this works, or how it could be used for what you want to do, feel free to e-mail me at adam@hatherly.com Optik aka Adam Hatherly 7th September 1999 |