You can access private members of another object by using the arrow operator:
right->key
The arrow operator is similar to the dot operator, except it implicitly derefrences the pointer on the LHS before accessing its members. The above statement is equivalent to:
if i declare node as pointer then this one doesn't work.
node->get_right().key ;
also this one.
node.get_right() ;
also when I'm going to use them as you said, i reach the error below,
The variable 'node2' is being used without being initialized.
actually it became the problem,
the first node (node) is not a pointer and i can use it,
the second node (node2) in a pointer and can be used for node,
But! when I'm going to set the right of node2 here there is a problem
The variable 'node2' is being used without being initialized. (again)
it doesn't get any value as key or any other pointer as right or left,
so if pointer does not get pointer,
and only class substance gets pointer,
and class substance doesn't get other class substances,
then how am i suppose to grow my binary search tree?