One notable problem is that you're returning by value in getSibling()
, so you'll get a copy of the sibling rather than that actual sibling. Any changes you make will be to the temporary object.
As others have noted, you're addSibling function should be sibling = p
. That's the source of your error.
But be sure to correct your getSibling function otherwise your setAddress won't do what you want.
JoshD
2010-10-03 18:48:26