how to pass a vector to a function code example
Example 1: c++ passing vector to function
// Pass by value
void print(std::vector<int> arr) { }
// Pass by reference
void print(std::vector<int>& arr) { }
Example 2: cpp function takes in vector
// Make sure to specify the type of the contents, as in:
void func(vector<int> vect)
{
vect.push_back(30);
}