Write about Global Variables

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.


Related

C Language 5547643469063463325

Post a Comment

emo-but-icon

item