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 Declaring and Initializing Structures in C Language?

Arrays can be used to represent a group of data items that belong to the same type, such as int or float. Array is not sufficient for representing a collection of data items of diff types using a s...

Write about Two Dimensional Arrays?

Two Dimensional Array is the combination of similar single dimensional array’s contains rows and columns. We can represent the data in Two Dimensional Arrays as table format. Two Dimensional Arrays...

How to Pass Structure Values as Parameters to Functions?

C supports the passing of structure values as arguments to functions. There are 3 methods by which the values of a structure can be transferred from one function to another. 1. The 1st method is to...

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