#include
using namespace std;
template class list {
dataType data;
list *next;
public:
list(dataType d);
void add(list *node) {
node->next = this;
next = 0;
}
list *getnext() {
return next;
}
dataType getdata() {
return data;
}
};
template list::list(dataType d)
{
data = d;
next = 0;
}
int main()
{
list start('a');
list *p, *last;
int i;
last = &start;
for(i=1; i <26; i++) {
p = new list ('a' + i);
p->add(last);
last = p;
}
p = &start;
while(p) {
cout << p->getdata();
p = p->getnext();
}
return 0;
}