so i got that first problem working. i run the code and i am prompt to enter some list into the array. after entering the list i run this function as a search_func. but it keeps return no record found. is it because of [0], odd because i have it within a for loop.
Please help. book books[] is a class object..
int search(book books[], char search) {
const char* boook =books[0].gettitle();
//......try this but it failed please help
cout << "Search books by title:____ ";
cin >> search;
bool yes = false;
int size=2;
for(int index=0; index<size; index++) {
if(strcmp(boook,search) == 0 )//....error at this line
{
found = true;
cout<<"book found "<<endl;
//cout<<"Author Name: "<<fn<<" "<<ln<<endl;
break;
}
}
if(!yes)
cout<<"no book found"<<endl;
}
std::string.std::stringworks with==; no need for antiquatedstrcmp.