Namespace x {f (); ...} Using statement: You can access member (single) recommended usage in the namespace! Using x :: f; Use instructions: Direct access to all members of the namespace Using Namespace X; not allowed to use a member of the class as a class, but a member of the class can be used as a member. You can provide a short alias for long name space: namespace att = american_telephone_and_telegraph; you can also use the namespace management version problem. Anonymous namespace is exactly the same as other aspects, just don't need to say it. Such as Namespace {...} equivalent to Namespace Unique_name {...} using namespace unique_name; local declarative name shades the same non-local statement, :: F meaning "The F" declared in the global scope " , X :: f means "the F" declared in the name space X "! The global variable should be at the same level with the main function, and the main function is not the same name space) A class is a name space in a certain sense, and all the operations that can be done by the name space can be in the same sense. Apply to classes, unless a certain operation is clearly prohibited. #include
// int b = 3; Namespace x {int a = 1; int b = 2;} using namespace x; using std :: cout; using x :: b; void main () {// int = :: A ; int I2 = :: b; // cout << "i1 is" <
<