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 you can, use the modern C++[11,14,17,...] way:
std::vector vec = {10,20,30};
The old way of looping over a variable-length array or using sizeof() is truly terrible on the eyes and completely unnecessary in terms of mental overhead. Yuck.
sizeof()