I've also tried changing the code to
but it hasn't worked either :\
Also, ideally, I would like to be able to populate the whole class on the same vector. Then push back to a new object, and populate the whole thing before pushing back again. How would I approach that? Would I keep using push_back?
From what im imagining, if i created another constructor(function in object?)
void Library::getAuthor (ifstream fin)
fin >> author;
but wrote it as this in the populateVectors function:
library.push_back(getBook(fin)); //after this line in the function
would that just set author in the new vector ?
To clarify, would it be allocated like this:
Because I am trying to make it so it is like this:
Sorry if its hard to understand what Im trying to say. I basically just want to have the 1st object filled fully instead of just filling 1 member of an object, and then pushing to another one.