104k views
2 votes
An array's size declarator must be a ________ with a value greater than ________.

A) number, one
B) number, zero
C) constant integer expression, zero
D) variable, -1
E) None of these

1 Answer

2 votes

Final answer:

The size declarator for an array must be a constant integer expression with a value greater than zero to validly define an array's size in memory.

Step-by-step explanation:

The answer to the question, 'An array's size declarator must be a ________ with a value greater than ________.' is C) constant integer expression, zero. When defining an array in programming, the size declarator must be a constant value known at compile time, and arrays cannot have a size of zero or negative, as that would imply no storage space or invalid memory reservation, respectively. In most programming languages, such as C, C++, and Java, the size of an array must be a constant integer expression, and it must specify a positive number of elements for the array to hold.

User Mattz
by
8.7k points