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
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item