I apologize if the answer is extremely obvious.
I wrote this small snippet of code that initializes a vector from an array

```
int arr[] = {1,2,3,4,5};
  vector<int> vec = {begin(arr), end(arr)};
  for (int i = 0; i < 5; ++i)
        cout << vec[i];

```

The code works fine, the only thing that bugs me is having to know the array size. The second parameter of the for,

```
i < 5;

```

just seem a bit too easy and not as accurate in a bigger piece of code. is there any way that I can have the code deduce the number of elements in the array as an integer and use that rather than stating the actual number of elements myself? I tend to find this annoying when using most arrays or vectors. I'm sure it would be a better habit to write something that would deduce the answer for me because I'm sure it could lead to miscalculations where user input is required and there is no limit to the amount of elements they input.