Related questions
How to initialize a vector in C++
I want to initialize a vector like we do in case of an array.
Example
int vv[2] = {12, 43};
But when I do it like this,
vector<int> v(2) = {34, 23};
OR
vector<int> v(2);
v = {0, 9};
it gives an error:
…
Arrays vs Vectors: Introductory Similarities and Differences
What are the differences between an array and a vector in C++? An example of the differences might be included libraries, symbolism, abilities, etc.
Array
Arrays contain a specific number of elements of a particular type. So that the compiler …