Search This Blog

Tuesday, 18 February 2014

understanding calling of variables

calling variables ...

#include<iostream.h>
#include<conio.h>

int a=2;   // global variable

void main()
{
int a=5;  //  local variable
cout<<"value is:"<<a<<endl;
cout<<"value of global variable is:"<<::a;
getch();
}

Output

value is:5
value of global variable is:2

No comments:

Popular Posts