PROGRAM FOR SCOPE RESOLUTION OPERATOR
//diff c & c++
#include<iostream.h>
#include<conio.h>
int m=10;
void main()
{
int m=20;
clrscr();
if(m==20)
{
int k=m,m=30;
cout<<"k="<<k<<"\n";
cout<<"m="<<m<<"\n";
cout<<"::m="<<::m<<"\n";
}
cout<<"m="<<m<<"\n";
cout<<"::m="<<::m<<"\n";
getch();
}
#include<iostream.h>
#include<conio.h>
int m=10;
void main()
{
int m=20;
clrscr();
if(m==20)
{
int k=m,m=30;
cout<<"k="<<k<<"\n";
cout<<"m="<<m<<"\n";
cout<<"::m="<<::m<<"\n";
}
cout<<"m="<<m<<"\n";
cout<<"::m="<<::m<<"\n";
getch();
}

Comments
Post a Comment