There might be a single way to define an array, but there is no one way when it come to the initialization of array.
C/C++ allows the initialization of array at the time of their declaration. The general form of initialization array is the same as of the variable initialization:
The value of the list is separated by a simple comma. All of these value are of the same type as the data type of the array. The first value is placed in the first position of the array, the second in the second place, and so on. Note that a semicolon follows the }.
This means arr will have value 1 and arr will have the value 10.
If you don’t initialize it, the elements of the array will have a random values assigned to it.
That is one way to initialize an element of an array.
The video below explains the concept of initialization: