Vector subscripting operator [ ]
Access to individual elements of a vector data type is provided through the use of square brackets, similar to how array elements are accessed.
The vector data type is followed by a set of square brackets containing the position of the element. The position of the first element is 0. The type of the result is the type of the elements contained in the vector type.
Example:
vector unsigned int v1 = {1,2,3,4};
unsigned int u1, u2, u3, u4;
u1 = v1[0]; // u1=1
u2 = v1[1]; // u2=2
u3 = v1[2]; // u3=3
u4 = v1[3]; // u4=4
Note: You can also access and manipulate individual elements of vectors with the following intrinsic functions: