Nothing is stored in moviesToRead after stepping through the readMovies() function, however it seems the vector in the function stores everything the way I need it to.
int main() {
vector <string>& moviesToRead = readMovies();
int size = moviesToRead.size();
for (int i = 0; i < size; i++) {
cout << moviesToRead[i] << endl;
}
}//main
When I step through the function, everything I need to be in it is.
vector<string> &readMovies(){
ifstream fin;
ofstream fout;
string movieName;
int size = 0;
vector<string> movieVector;
cout << ENTER_MSG[0] << endl;
string fileName;
cin >> fileName;
fin.open(fileName);
while (getline(fin, movieName)) {
movieVector.push_back(movieName);
}//while file exists
return movieVector;
}//read movies from file