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

Write about Dynamic Arrays?

An arrays created at compile time by specifying size in the source code was a fixed size and cannot be modified at ran time. The process of allocating memory at compile time is kn...

Write about Operators in ‘C' Language?

C supports a rich set of built-in operators. Operator: operator is a symbol that tells the computer to perform certain mathematical (or) logical manipulations. Operators are used i...

What is an Arithmetic Expression? Write the procedure for evaluating an Arithmetic Expression?

An arithmetic expression is a combination of variables constants , and operators arranged as per the syntax of the language . C can handle any complex mathematical expressions. Ex:–   x...

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