3 ms·
Agreed. So... why does it?
by crazygringo 6y ago
Agreed.
So... why does it?
- adonovan 6y agoBecause it's simpler. C has no concept of nested functions. If it instead allowed users to write the statements of 'main' at the top level, it would complicate the rules for scoping. For example, can an inner function access the outer function's variables? Or jump to its labels? Simpler just to say: all statements live in a function; functions don't nest; and execution starts at main.