i want to be able to add to the frequency of a word in a text file. But as the function i have below finds a function i want it to add to the frequency each time the words is found again.
int BinTree::find(string word)
{
BinNode *temp=root;
bool found=false;
while(!found && temp!=NULL)
{
if(temp->data==word)
{
found=true;
temp->data_num+1;
}
else if(word<temp->data)
temp=temp->left;
else
temp=temp->right;
}
//return temp->data_num;
return 0;
}
if i return the commented out code it will give me a error.