using namespace std
时间: 2023-10-21 21:04:35 浏览: 71
C++中的using namespace std
The "using namespace std" statement is used in C++ to avoid having to type "std::" before every use of a standard library function or object. It essentially tells the compiler to use the namespace "std" by default, which includes a variety of standard C++ objects and functions. Without this statement, one would have to write "std::cout" instead of just "cout", for example. It is generally considered good practice to avoid using "using namespace std" in header files, as it can cause naming conflicts if different namespaces are used in different files.
阅读全文