If you need to use the C + + input (CIN) or output (cout) tool in your program, you must provide two lines of code:
1 #include <iostream>2usingnamespace//can use the space name for something inside STD
This code appears when I build a C + + project called Helloword:
1 using namespace //You can use the space name for something inside the Helloword
The purpose of introducing namespace namespace in C + + is to prevent multiple programmers from having a function or variable duplicate name when writing the same project. The following code can be compiled by:
1#include <iostream>2 using namespacestd;3 4 namespaceX5 {6 intA=2;7 }8 9 namespaceYTen { One intA=3; A } - - voidMian () //Although the program defines three variable a within the same file, they belong to different spaces and can be compiled. the { - intA=1; - using namespaceA; - using namespaceB; +cout<<"m,a="<<a<<Endl; Output: A=1 -cout<<"x,a="<<A::a<<Endl; Output: a=2 +cout<<"y,a="<<B::a<<Endl; Output: A=3 A}
C + + "using namespace std;" The understanding