Which of the following can be declared in C++?

Options

  • A. An array of integers
  • B. An array of class objects
  • C. An array of structures
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

D. More than one of the above

Detailed Explanation

Answer: (D) More than one of the above

C++ allows arrays whose elements can be different user-defined or built-in types.

For example, an array of integers can be declared as:

int a[5];

An array of class objects can also be declared:

Student students[10];

Similarly, an array of structure objects is possible.

Therefore, all three statements are possible, making (D) the correct answer.