Consider the statement
int val[2] [4] = { 1, 2, 3, 4, 5, 6, 7, 8} ;
4 will be the value of
Answer: A
Correct answer: val[0 ][ 3]
A brace-list without inner braces fills a two-dimensional array row by row. With 4 columns, the first row takes 1, 2, 3, 4 and the second 5, 6, 7, 8. The value 4 is therefore the fourth element of row 0, that is val[0][3]. val[0][4] is out of bounds, and val[1][1] is 6.
Please log in or register to report this question.