In my program I am trying to cin a book title and have it search my book.txt document for the book. However I cannot get my function to cin the whole title without spaces.
Below is my function and code any help would be appreciated.
Function:
void titleInfo(Book* books, int numBooks, string& query)
{
cout << "search string = " << query << endl;
for (int i = 0; i < query.length(); ++i)
{
Book& current = books[i];
if (current.getTitle() == query)
current.print();
}
}