OOPS referring to tree

How can we change the data of a node by following method//

node*temp=root;
(where root is a previously created node)

because temp is just a copy of root
and we know that any change made in the copy does not reflect in the actual data
so how a change made in temp reflects in the root
like changing left or right pointers or so

@anshuman_U as we have the functions inside the class only, so any changes made to copy of original will be reflected back in original.(As if we have created a function and passed it using a reference)
If the function was outside the class and root is not passes using reference then we will not see any changes made to temp reflected in root.
If this resolves your doubt mark it as resolved.