#include #include using namespace std; struct People { string name; int bdate; string phone; People * others; People(string n, int b, string p, People * o) { name = n; bdate = b; phone = p; others = o; } void printone() { cout << name << ", born " << bdate << ", ph " << phone << "\n"; } }; int main() { People * a; // horribly uninitialised variable // will cause trouble eventually a = new People("Jill", 19980720, "111-2222", a); a = new People("Joe", 20011213, "222-3333", a); a = new People("Jane", 19990306, "111-3232", a); a = new People("Jim", 20000826, "111-4444", a); a = new People("Jeff", 19991101, "222-1234", a); a->printone(); a->others->printone(); a->others->others->printone(); a->others->others->others->printone(); a->others->others->others->others->printone(); a->others->others->others->others->others->printone(); // that is where the uninitialised variable caught up with us. }