Program in c++ of using scope resolution operator


#include<iostream.h>
#include<conio.h>
int b=100;
void main()
{
clrscr();
int b=50;
            {
            int bh=b;
            int b=25;
            cout<<"we are in the inner block";
            cout<<"bh="<<bh<<"\n";
            cout<<"b="<<b<<"\n";
            cout<<"::b="<<::b<<"\n";
            }

cout<<"\nwe are int the outer block\n";
cout<<"b="<<b<<"\n";
cout<<"::b"<<::b<<"\n";
getch();
}


Output:


About the Author

Unknown

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

Post a Comment

 
My Study Voice © 2015 - Designed by Templateism | Distributed By Blogger Templates