I'm writing a "family tree"program. there's a function in my class Node which is named SON. it gets 2 strings as arguments (they represent the name of the son and the father to be related respectively). I've got a problem here. if you look at the code below:
Does it make sense to do so? doesn't function SON, mix up the father and son with the one in the outer scope?
vector<Node *> kid;
void ADD(string s)
Node *n= new Node;
void SON(string s, string f)
for(int i=0 ; i<nom.size() ; i++)
Yeah, it does. Why are you doing this?
Originally Posted by Farnaz
the father, whose name is passed to the function, may have some other sons and this son is not necessarily the father's first son. so it has to be pushed back in a vector (kid). I should tell the son this father is his father and vice versa. what do you suggest me?