c++ arrays

Arrays in C++

In C ++, several variables of the same type can be combined into an array. The elements of the array are accessed via an index. When defining, the type of elements and the size of the array must be specified. The index of the array always starts at 0, so the length of the array equals length – 1.

Actually, the compiler determines the size of the array itself. It is recommended not to use this automatic size determination. If the size was explicitly specified, the compiler will give an error if the number of initiating elements does not match the size specification.