0

Hi,
I want to pass tree as an argument to other function in C. I am able to pass the tree comfortably,but how do I access the children of the tree in the called function???

TIA
Best Regards
Vishal Agarwal

2
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by Sky Diploma
0

Welcome to the forum Vishal, Your question is very faint for us, without knowing your actual implementation. Please post example codes so we can have an idea about what exactly your problem is.

0

Thanks a lot for such a quick reply.
I cannot post the code..I am very sorry for this.
BUt to be more precise, I am creating a tree say T in a function say F1. After that another function say f2 is called from f1 with the tree T as one of the argument. Upto this it is fine.
Now I want to access the nodes of T from f2. How do I do that??

Did I make myself clear???Sorry for my english.

Best regards
Vishal Agarwal

0

Are you sending a copy of the object or a reference.
Or is it through a pointer .

class Tree{
//values
};

void f1()
{
  Tree x;
 //put values into x
 f2(x);
}

void f2(Tree& temp)
{
//DO something with tree(temp)
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.