Once I assumed that these two have the same meaning but after reading more about it i\'m still not clear about the difference. Doesn\'t the local scope sometimes refer to sc
The scope of the function is slightly larger than the scope of the function body: The function arguments are in the outer scope, while local variables are only in the inner one. This is most visibly manifest in a function-try-block:
void f(int a) try {
// function body
} catch(...) {
// catch block
}
Inside the catch block, only the variables in function scope are still in scope, but not the local variables.
Of course you can and do also introduce further, deeper nested scopes all the time, e.g. in for
loop bodies or conditional bodies.