Question 1
Topic: Block 1 Language and Structures: Declarations, Definitions, Lexicon, Structures
Skill tested: Distinguishes valid array initialization from invalid excess initializers.
A telemetry utility stores exactly four calibration offsets in a fixed-size array. The values must be initialized when the array is defined, and the team wants the compiler to infer the array length from the initializer. A later maintenance change must not silently add a fifth initial value without changing the intended four-element design. Which definition both compiles and declares an array containing exactly four elements?
With an omitted bound, an array's size is inferred from the number of initializer elements, so the definition in A creates four integers. B has too many initializers for its declared bound and violates a constraint. C is valid C, but it initializes a four-element array with the first three values and zero-initializes the remaining element; it does not meet the request to infer the bound. D declares a scalar int, which cannot be initialized with four separate values.