How can I create a linked list using a base class and a derived class

Eg.:

```
class Base { 
    int id;
    Base *next;
};
class Derived : public Base {
    string name;
};  

Base *list = NULL;

Base *b = new Base();
b->next = list;
list = b;

Derived *d = new Derived();
d->next = list;
list = d;

Base *itr = list;
while(itr) {
    if(typeid(Base) == typeid(*itr)) {
        cout << "Base: " << itr->id << endl;
    } else {
        cout << "Derived: " << itr->id << " and " << itr->name << endl;
    }
    itr = itr->next;
}

```

My approach does not work! Any suggestions?