how to pass a vector to a function in c++ code example
Example 1: convert vector to set c++
#include <set>
std::set<std::string> set_name(vector_name.begin(), vector_name.end());
Example 2: c++ passing vector to function
// Pass by value
void print(std::vector<int> arr) { }
// Pass by reference
void print(std::vector<int>& arr) { }