i have vector of pointers: std::vector<Customer*> customersList
Now i want to get one of the elements and make my operations on him.
i'm not sure that i know how, my guess was:
Customer* source = restaurant.getCustomer(cust);
the problem is that i don't know if in c++ it will create new object or i will just get a reference to him. There is my getter method:
Customer* Table::getCustomer(int id) {
for (int i = 0; i < customersList.size(); ++i) {
if (customersList[i]->getId() == id)
return customersList[i];
}
return nullptr;
}
Thank you