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
Explain about Evaluation of Expression in c language? An Expressions are evaluated using an assignment statement of the form: variable = expression; The Variable is any v

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

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

Public, Private and Protected members: Class members can either be declared in public','protected' or in the 'private' sections of the class. But as one of the features of OOP i

Object Conversions Just like initialization, conversions are also done automatically when an object of a derived class is assigned to an object of the base class. Though, the c

Define Generic Bitwise Operations? Bitwise operators only work on an incomplete number of types int and char. It turns out there's above one kind of int. In particular there's

#question.develop an algorithm using pseudocode for computing cos(x) and sin(x). use a sentinel controlled while loop. use the series definition of e^+-jx

A: Use operator overloading to present a friend left-shift operator, operator #include class Fred { public: friend std::ostream& operator ... private: int i_; // onl

Write a Program to illustrate Array with Strings? main() { static char name[]="devdas"; int i; i=0; while(name[i]!='\0') { printf("%c",name[i]); i=i+1; } } In the

Question : (a) What is a structure? Provide a simple example of your own to illustrate this feature. (b) How does a structure differ from an array? (c) Describe a structu