Will the use of nested if in C programming impact the stack usage?
Nested if & Stack
Collapse
X
-
Tags: None
-
From a practical point of view, Jos is right ... the nested if's themselves won't cause any stack usage. However, the statements within the if/the/else blocks could use stack (automatic variable declarations, function calls, etc).Originally posted by JosNo, a few (conditional) jumps take care of it all.
From a pedantic point of view, the C Standard imposes no requirements on how an implementation makes use of stack. For that matter, the C Standard does not require that the implementation has a stack at all. So anything you learn about stack usage by your compiler could be invalid on another compiler.Comment
Comment