How to Convert an Array to a Vector in C++?
In this article, we will learn how to convert the given array into vector in C++.The simplest method to convert an array to vector is by using range constructor of vector. Letâs take a look at an example:C++#include <bits/stdc++.h> using namespace std; int main() { int arr[] = {1, 3, 6, 2, 9};