What's the error? You shouldn't use .eof(), you should just do

while (fin >> book)
cout << endl << book << endl;