I have this weird problem.
If my constructor is
[header]
class Book
{
private:
vector<string>Entry;
public:
Book();
[cpp]
Book::Book(){
Entry.push_back("0");
Entry.push_back("1");
Entry.push_back("2");
The weird thing is that it does not update when I do more .push_back.
I use:
void Book::addItem(vector<string>newItem)
{
for(int f=0; f<Entry.size(); f++)
{
Entry.push_back(newItem[f]);
cout<<Entry[f];
}
}
when i display all the items in Entry, only the ones in the constructor is displayed, and not all the additional ones I add through addItem().
I don't know what's wrong...!!!
How to fix???