Here is an example using templates
Code:
#include <iostream>
using std::cout;
using std::endl;
#include <list>
using std::list;
// main returns int!
int main(void)
{
list<char*> L;
L.insert(L.begin(), "Hello World!");
L.insert(L.begin(), "Good bye!");
L.insert(++L.begin(), "Inbetween");
// traverse list
typedef list<char*>::const_iterator LI;
for (LI i = L.begin(); i != L.end(); ++i)
cout << *i << endl;
return 0;
}
You will have to read a little infomation on how the stl works. Once
you know how to use a list creating a list shouldn't be too hard.