Scope in C++.


The :: operator is used within C++ to identify global variables that conflict with local variable names. Obviously it would be good programming practice to use suitable names in the first place......


        #include 
        
        int Counter = 1;
        
        main()     
        {
            int Counter = 1;
            
            for (int i=0; i< 10; i++)
            {
                cout << Counter << " " << ::Counter << endl;
                Counter++; 
            }
            
            return 0;
        }


Examples:

o Example program.


See Also:

o C++ operators..

C References

o Global Variables.

o C Expressions and Operators.


Top Master Index Keywords Functions


Martin Leslie

next.git/commit/arch/sh/kernel/cpu/sh2/entry.S?h=nds-private-remove&id=5db4992d8f040b8d8db0b86d42806e0c417f7ccf'>commitdiff

path: root/arch/sh/kernel/cpu/sh2/entry.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/cpu/sh2/entry.S')