19.
MathWorks technical mcq question, verified with a worked answer. Free to practise - no sign-up.
(C Question) Pointers in C**
While thinking of pointers, how many levels of indirection does ANSI C standard say you must have in a single declaration?
Pick ONE option
Show answer & explanation
The ANSI C standard (C89/C90) specifies a minimum requirement that compilers must support at least 12 levels of indirection in a single declaration (e.g., pointer-to-pointer-to-... structures). This is a minimum capability requirement for compilers, not a maximum. The question asks what the standard "says you must have," which refers to this minimum guaranteed support. Option B correctly interprets this as "at most 12"—meaning 12 is the guaranteed floor, and implementations may support more.
Step-by-step Derivation:
The ANSI C standard (Section 5.2.4.1 of the C89 standard) defines translation limits, which specify the minimum number of levels of indirection that a conforming C implementation must support. This limit is 12. Since this is a minimum requirement for compilers to be ANSI-compliant, any conforming compiler must handle at least 12 levels. The phrasing "at most 12" in option B captures this as the guaranteed minimum—you are assured of having up to (at least) 12 levels of indirection available. Options A and C are too high/low, and option D is too restrictive.