I can create an array and initialize it like this:
int a[] = {10, 20, 30};
How do I create a std::vector and initialize it sim
std::vector
If the array is:
int arr[] = {1, 2, 3}; int len = (sizeof(arr)/sizeof(arr[0])); // finding length of array vector < int > v; std:: v.assign(arr, arr+len); // assigning elements from array to vector