7.3: No Bounds Checking in C++

STUDY
PLAY
Suppose v is an array with 100 int elements. If 100 is assigned to v[100], what happens?

The compiler issues an error message.
The compiler issues a warning message.
The program will terminate immediately.
Another variable or array will very likely be unexpectedly modified.
Another variable or array will very likely be unexpectedly modified.
QUESTION 1: Correct

An array of 1000 integers is declared. What is the largest integer that can be used as an index to the array?

1001
1000
999

QUESTION 2: Correct

Consider the declaration: int v[1]; What is the index of the last element of this array?

0
1
2
999; 0;
YOU MIGHT ALSO LIKE...