if i'm not mistaken, you can just allocate memory for shit in C++ by calling "new".
also, it's not actually that arduous to do all those things if you do it intelligently.
something like
Code
steve1 = new Person("Steve1")
mary = new Person("Mary")
steve2 = new Person("Steve2")
steve.setspouse(mary)
steve.addchild(steve2)
the only part that looks remotely like a challenge is figuring out how to get to one of those people (i.e. you're done adding steve1, his spouse and his kids, now you need to setup steve2, his spouse and his kids). for that you need to either do some tree traversal, or if you want to cheat, just maintain a global list of pointers to all the people in existence, and use that to access the people directly.
start by writing out what that might look like in the absence of methods and functions. then start observing patterns and repeated lines of code that you could extract into a function and/or a loop (or recursion).
but once again, remember that the purpose of all these assignments isn't really about getting The Right Answer (there's no single Right Answer anyway). it's about developing your thought process to get to *an answer*. so if you're getting stuck, the best thing to do instead of just writing more code is to see if you can somehow modify/change your approach to make the problem easier. also, speaking from experience, a naive/brute force approach is usually a good starting point, because it sets the foundation for both understanding the problem more fully, and for iterating to a better solution.
in this particular case, a naive/brute force approach would be the one i laid out above --- write a solution that's tailored specifically to the example you're given, and then try to generalize your solution from there by adding or subtracting things from the example and seeing what part of your solution breaks down in what kinds of situations.
This post was edited by irimi on Nov 18 2012 06:24pm