I am trying to search my linked list that stores data about books. this data is held in a class called proceedingsBook. i am searching on there ISBN number. my search function currently looks like this:
void LnLinkedList::find(proceedingsBook key)
{
LnNode *nodePtr;
//let pointer point to first element in list
nodePtr = _begin;
proceedingsBook data_temp;
while(nodePtr != NULL )
{
data_temp = *nodePtr->getData();
if(data_temp.getIsbn() == key.getIsbn())
{
_current = nodePtr;
return;
}
nodePtr = nodePtr->getNextNode();
}
_current = NULL;
throw exception(NOT_IN_LIST);
}
When calling the funtion this is how i am trying to pass the data:
1 2 3 4 5 6 7
proceedingsBook search;
int isbnToFind;
cout<<"enter the ISBN of the book you would like to search for:"<<endl;
cin>>isbnToFind;
search.setIsbn(isbnToFind);
myList.find(search.getIsbn);
However i am getting this error on line 7: error C3867: 'Publication::getIsbn': function call missing argument list; use '&Publication::getIsbn' to create a pointer to member
(proceedingsBook inherits from the class Publication)
It seems like i need a pointer somewhere but im not sure where, ive tried switching a few things around but i cant get it to work, any help would be great
ah yes, putting those brackets in made me realise i dont want to actually pass the .getIsbn into the funtion i just needed to pass in the whole class proceedingsBook, got it working now thanks