Original Post
I am trying to pass a new "vector element" from a function back into a main vector of objects without using a pointer. The following code is the sub function that compiles but does not pass into the main vector d; where Dog is a class. void add_dog(vector& n) { string name; int age; cout << "name : "; cin >> name; cout << "age (1 - 12) : "; cin >> age; Baby new_dog(name, age, 0, 0, 0); new_dog.show_dog(); new_dog.temper(); /** b.push_back(new_dog); for (int i = 0; i < b.size(); i++) { b.show_dog(); } */ }