Close, but not quite. The main problem is that the index i loops from 0 to one less the vector size. books.name does not exist, since vectors do not have a name member. A more minor problem is that the type of the index should be vector<data>::size_type, not int. Then, after you have found a matching element, you may wish to break out of the loop (or you may not, it depends). Consequently, a more likely solution would be:
Code:
vector<data> books;
// ...
cin >> search_input;
for (vector<data>::size_type i = 0; i < books.size(); ++i)
{
if (books[i].name == search_input)
{
cout << "Found with title: " << books[i].title << endl;
break;
}
}