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
For vector initialisation -
vector v = {10,20,30}
can be done if you have C++11 compiler.
Else, you can have an array of the data and then use a for loop.
int array[] = {10,20,30}
for(unsigned int i=0; i
Apart from these, there are various other ways described above using some code. In my opinion, these ways are easy to remember and quick to write.