int orgCount, newCount;
wordcount *wrdPtr;
wrd = words.find(*wrd);//error: invalid conversion from 'const wordcount*' to 'wordcount*'
orgCount = &wrdPtr.getCount;//error: request for member 'getCount' in 'wrdPtr', which is of non-class type 'wordcount*'
newCount = orgCount + 1;
words.erase(*wrd);
wordcount *exwrd = new wordcount(tempWord, newCount);
words.insert(*exwrd);
I am trying to get the address by calling words.find(*wrd), then get the count number of that object from the address.
wordcound is the class name.
here is my getCount():
1 2 3 4
constint getCount() const
{
return count;
}
and find(), which can not be changed in any ways:
1 2 3 4 5 6 7 8 9
const dataType* find(const dataType &findData) const
{
// this function looks for findData in the tree.
// If it finds the data it will return the address of the data
// in the tree. otherwise it will return NULL
if (root == NULL) return NULL;
elsereturn root->find(findData);
}
wordcount *wrdPtr;
wrdPtr = words.find(*wrd);
// error: invalid conversion from 'const wordcount*' to 'wordcount*'
orgCount = wrdPtr->getCount;
//error: argument of type 'int (wordcount::)()' does not match 'int'