(according to ANSI specifications)
How many levels of nesting must be supported by a computer ?
Collapse
X
-
Refer to C99 section 5.2.4.1 (Environmental Limits: Translation limits). This tells us that a conforming implementation must be able to translate and execute a program containing at least one instance of the following nesting-level related limits:- 127 nesting levels of blocks
- 63 nesting levels of conditional inclusion
- 63 nesting levels of parenthesized declarators within a full declarator
- 63 nesting levels of parenthesized expressions within a full expression
- 15 nesting levels for #included files
- 63 levels of nested structure or union definitions in a single struct-declaration-list
- (Perhaps other limits that I didn't see when I skimmed C99 for this post.)
So it is clear that Banfa and RedSon are right -- the answer depends on just what it is that you're trying to nest.Comment
Comment