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 should pass the vector by reference to modify the original global vector.
void addBook(vector<BookData>& books)
^^^
Otherwise you are passing a copy of the original vector to the function and modifying that not the global version.
You need to pass your vector as a reference wherever necessary. In that specific instance, you just need to change
void addBook(vector<BookData> books)
to:
void addBook(vector<BookData>& books)
otherwise your function gets a copy of the vector, not a reference to the original one.