Scope rules of functions and Formal parameters of a function in C

Scope rules of functions: Scope rules are the rules that govern access of a code block by another code block. For functions, a code block within the function is private for that function and other statement can’t access it unless it makes a function call. The code block within the function is actually hidden for the program unless it uses global variables. A variable inside a function is a local variable and gets terminated when the function is over.

Formal parameters of a function: For a function to use arguments it has to declare variables. These variables accept the values of arguments and are known as the formal parameters.  They are like local variables.

Leave a Reply