Which of the following does not initialize all of the array elements to 0?

a)
int b[2][2];
b[0][0] = b[0][1] = b[1][0] = b[1][1] = 0;
b) int b[2][2] = {0};
c)
int b[2][2];
for (int i = 0; i < 2; ++i) {
for (int j = 0; j < 2; ++j) {
b[i][j] = 0;
}
}
d) all of the above initialize all of their elements to 0.
ANS: d)

6.51 Which statement is false about multidimensional arrays?
a) C supports multidimensional arrays.
b) A common use of multidimensional arrays is to arrange data into tables consisting of rows and columns.
c) To identify a particular table element requires two indices.
d) Every ANSI C system can support arrays with as many indices as the programmer chooses.

c) To identify a particular table element requires two indices.

Computer Science & Information Technology

You might also like to view...

A ________ document serves as a container for the different parts of a Word document

A) new B) master C) combined D) subdocument

Computer Science & Information Technology

Application banner information is typically recorded during what penetration testing phase?

A. Planning B. Attack C. Reporting D. Discovery

Computer Science & Information Technology