I'm trying to obtain a value through recursive calls, the problem I am encountering is that the first call has the same function which causes it to overwrite the variable I am trying to obtain.
//some variables I'm using
stringCount = 0;
value = '>';
char dLetter;
//the function I initially use
Traverse(root, value);
//the container for a node
typedefstruct treeNode //container for a node
{
char letter; //letter of node
treeNode* leftChild; //points to next node
treeNode* rightChild; //points to previous node
};
treeNode* root;
//stuff you should know
root->letter = a;
(root->rightChild)->letter = p;
I want this to return dLetter = tree->letter of the last node traversed to, which would make dLetter = 'p', but once reaching the base case, it reads the previous Traverse() function as well making dLetter then equal that node's letter, which is 'a' (the root node).