Tuesday, 24 February 2015

Scope Resolution Operator in C++

/*
::  scope resolution operator
*/

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

void AccGlobe(); // Function Declaration
int a=10;

main()
{
int a=100;
clrscr();
cout<<"\n Global Variable :"<<::a;
cout<<"\n Local Variable :"<<a;
AccGlobe();
getch();
}
void AccGlobe()
{
cout<<"\n Global Variable Within Function :"<<::a;
}

No comments:

Post a Comment