Original Post
The following code is an attempt to remove a specific element from a vector of objects based an entered name where .dog_name is a class private member but knowing that I cannot access a private member method from outside the class definition, how would I pass the vector to the class or make this run as function called from main? (code does NOT compile yet) void depart_dog(vector<Dog>& d) { string name; cout << "which dog? " << endl; cin >> name; cout << name << " is going home. Bye!" << endl; cout << endl; for(int i = 0; i < d.size(); i++) if(name == d.dog_name) d.pop_back(); }