What is scope resolution operator, C/C++ Programming

Scope Resolution operator:

The scope resolution operator: : is used to access global variable in the inner block. When global and local variable are identical name the scope resolution operator will help to access the global variable in the inner block.   This cannot be done in C programming.   This operator will read only the global variable.

 

int x=10;

int main()

{clrscr();

int x=100;

{

int x=1000;

cout<<"\n"<

}

cout<<"\n"<

return 0;

}

 

Posted Date: 9/20/2012 7:36:27 AM | Location : United States







Related Discussions:- What is scope resolution operator, Assignment Help, Ask Question on What is scope resolution operator, Get Answer, Expert's Help, What is scope resolution operator Discussions

Write discussion on What is scope resolution operator
Your posts are moderated
Related Questions
The program must use the file named on the command line as its input file. Suppose the program is named pdbtool. Then if the user types pdbtool 1A36.pdb the program must read the d

how many bytes required to char

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Classes and Objects A class is a vehicle to execute the OOP features in the C++ language. Once a class is declared, an object of that type can be explained. An object is said t

#include #include using namespace std; class Book { private: string title; int iD; int year_pub; string author; public: string getTitle(); int getId(); int getYear_Pub(); st

Implement a Algorithm to verify if the link list is in Ascending order? A: template bool linklist::isAscending() const{ nodeptr ptr = head; while (ptr->_next)

write a program to accept ten numbers and display the total

This problem familiarizes you with using random numbers in C++. The program is to compute a good approximation of π using a simulation method called "Monte Carlo". The following fi

explain me for loop

Program is to replace every occurrence of in a string: Program is to replace every occurrence of c1 in string with c2 and have function return the no. of replacement int re