0
Why the size of int a =[5] is 5 instead 6 , isn't the first term is 0?
5 Answers
+ 5
The last element of an array with size [5] has the index 4.
+ 1
The size of the array is 5 and according to formula "index=array size-1" so Index is 4
+ 1
The index is like this 0,1,2,3,4
That means size is 5 not 6
0
When sending or retrieving the length of an array, you're dealing in a one-based system. Whereas locating an element at a specified index in an array is zero-based. Thus, we can deduce that `int a[5];` is dealing with length, which is a one-based system.
0
the number , which is put between the brackets , is the count of the array elements