function scope

Hi. what is the scope of a function. can you please include an example. Thanks for your help. Thanks for your example. so the scope of the function is its definition or what it is designed to do, correct? and its definition is unique.
Last edited on
1
2
3
4
void foo()
{ //Begin scope
   //do stuff...
} //End scope 
Last edited on
There is no exact definition of the function scope in the C++ Standard. But it may be considered as all body of a function. Labels have function scope, because they my be used anywhere in the function where they are declared. Only labels have function scope.
Topic archived. No new replies allowed.