18 Aug 2019

  • August 18, 2019
  • Amitraj










Scope resolution operator in C++

Scope resolution operator (::) in C++ programming language is used to define a function outside a class or when we want to use a global variable but also has a local variable with the same name.

// cpp program on scope resolution               bY Amit rajpurohit
http://codevidyalay.blogspot.com

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

//INPUT/OUTPUT:-
89
120


Translate

Popular Posts