From 7e0f021a9aec35fd8e6725e87e3313b101d26f5e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 27 Jan 2008 11:37:44 +0100 Subject: Initial import (2.0.2-6) --- reference/CPLUSPLUS/CONCEPT/scope.html | 100 +++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 reference/CPLUSPLUS/CONCEPT/scope.html (limited to 'reference/CPLUSPLUS/CONCEPT/scope.html') diff --git a/reference/CPLUSPLUS/CONCEPT/scope.html b/reference/CPLUSPLUS/CONCEPT/scope.html new file mode 100644 index 0000000..74f651e --- /dev/null +++ b/reference/CPLUSPLUS/CONCEPT/scope.html @@ -0,0 +1,100 @@ + + +Scope in C++ + + + +
+

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 + +

+ + + -- cgit v1.2.3-54-g00ecf