This is my code... they view error on vector book(5), Why?
#include<iostream>
using namespace std;
struct letter
{
string name;
int age;
};
vector<letter> book (5);
int main()
{
int n,i;
cin>>n;
while (book.size()<n-1)
{
book.resize(book.size()++);
}
for (i=0;i<n;i++)
{
cin>>book[i].name;
cin>>book[i].age;
}
cout<<"Information Added!!!\n";
}