Which option shows the correct form of an array declarator in C?
2026
Which option shows the correct form of an array declarator in C?
Answer: A. int arr[] — ConceptIn C, an array declarator is formed by attaching square brackets to a declarator identifier. The brackets may contain an array bound; in contexts…
- A.
int arr[]
- B.
array int arr
- C.
int arr{}
- D.
int arr
Attempted by 126 students.
Show answer & explanation
Correct answer: A
Concept
In C, an array declarator is formed by attaching square brackets to a declarator identifier. The brackets may contain an array bound; in contexts permitted by the language, the bound can be omitted.
An omitted bound produces an incomplete array type. Some declaration contexts permit that form, such as an extern declaration, while an object definition that needs a complete type must obtain its size from a bound or initializer.
Application
Read
intas the element-type specifier.Read
arras the declarator identifier.Read
[]as the array-declarator suffix attached toarr; thereforeint arr[]is the offered form that uses C array-declarator grammar.
Contrast
array int arrusesarrayas a prefix keyword, but C has no such declaration keyword.int arr{}uses braces, which are associated with initializer syntax rather than the array-declarator suffix.int arrdeclaresarrwith scalar typeintbecause no array suffix is present.
Cross-check
A concrete complete example is int arr[5];: the type is int, the identifier is arr, and the postfix brackets make it an array declarator. Removing only the bound leaves the same declarator form, int arr[], though whether that incomplete form is allowed depends on context.
Result
Among the offered forms, int arr[] has the C array-declarator structure.