Scoping in Functions
Variable visibility rules (block, method, class).
functionsscopeUpdated 2025-09-01
Lexical Scope
- Defined by code structure at compile time.
Block Scope
- Variables inside { } not visible outside.
Example
- for(int i=0;i<3;i++){} // i not visible here