I have a vector of class objects I\'ve created in main by reading in a data file. I\'m then passing around the vector to several different files containing functions that p
You need to pass your vector as a reference wherever necessary. In that specific instance, you just need to change
void addBook(vector books)
to:
void addBook(vector& books)
otherwise your function gets a copy of the vector, not a reference to the original one.