I built a class type 'books' which includes the title and the price of a particular book. And I want to use vectors to store all the books information I have. This code should be able to get all the books' information and store them into the vector.
But it seems no possible to use xxx.push_back(yyy) or iterators to add new elements to vector<books>.... Could anyone show me the correct way to deal with this kind of problem?
Thanks in advance.
This is the code I used by mistake.
using namespace std;
cout<<"Please input the name of the book"<<endl;
cout<<"Please input the price of the book"<<endl;
cout<<"Another book info?"<<endl;
cout<<"The Books Stored:"<<endl;