Write about Global Variables
https://www.computersprofessor.com/2016/12/write-about-global-variables.html
Global variables:
|
The variables which are declared
above all the functions are known as global variables. These variables are
created at the time of program begin and resides in memory until the whole
program executes.
Global variables are common to all
the functions in the program.
Ex:
int x =10;
void main( )
{
int y =5;
void fn( );
fn( );
printf (“%d”, y);
}
void fn( )
{
printf (“%”d” ,x);
}
Here x is global variable.
|