0
Why?
need array with size 9, true answer int array[8], why it's wrong answer? we start numeration from zero, 012345678, this 9.
2 Answers
+ 4
int array[8] has a size of 8.
Remember that 8 itself is not included and the index goes like 0,1,2,3,4,5,6,7.
0
declaring the array you start from 1, accessing it you start from index 0
int a[9]={0,1,2,3,4,5,6,7,8};
cout << a[3]; //3
cout << a[9]; //error