I apologize for being vague and only posting partial code but my assignment is complete except for this one thing. I am making a program that searches a library and returns only the books that partially or completely match the authors name. currently my program always returns all of the books.
I think the problem lies in line 21. no matter what I type the program returns the entire library. I think that find is always returning true. however I have no idea what to do to make the program only print matches of partial strings...
any help is appreciated and am I on the right track?
void actions (char response, int lineCount)
{
int index = 0;
char search [256];
response = toupper(response);
switch (response)
{
case'A':
cout << "you selected search by (A) author \n";
cout << "please enter the author you would like to find";
cin >> search;
for (index =0; index < lineCount; index ++)
if (bookAuthor[index].find(search))
{
cout << bookTitle[index] << "(" << bookAuthor [index] << ")\n" ;
}