how to change a number in a vector for 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++ initialize a vector
#include <bits/stdc++.h>
#include <vector>
using namespace std;
int main()
{
// This vector initializes with the values: 10, 20, and 30
vector<int> vect{ 10, 20, 30 };
return 0;
}