Local variable or function:
A variable or function declared inside a function is called local variable or function. This cannot be accessed by the out-side of the function.
eg:
main()
{
int k; // local variable
cout<<sum(a,b); // local function
}
Global variable or function:
A variable or function declared out side of a function is called global variable or function. This can be accessed by any statements.
eg:
int k; // global variable
int sum(int a, int b); // global function
main()
{
}