Wednesday, March 28, 2018

Write a C++ program for scope access operator on scope resolution operator.


AIM: Write a C++ program for scope access operator on scope resolution operator.

THEORY:

In computer programming  scope is an enclosing context where values and expressions are associated. The scope resolution operator helps to identify and specify the context to which an identifier refers, particularly by specifying a  namespace . The specific uses vary across different programming languages with the notions of scoping. In many languages the scope resolution operator is written "::".

SOURCE CODE:

#include<iostream>
using namespace std;
int a=10;                                                  
int main()
{
            int a=120;
            cout<<"::a= "<<::a<<endl;
            cout<<"a= "<<a;
}

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home