Start here · Essential guide
Using Namespace std in C++ Explained
Learn what using namespace std does in C++, why many developers avoid it in real code, and safer options like std:: and narrow using declarations.
Syntax and Functions
What namespaces are, what std means and when to write std:: yourself.
Start here · Essential guide
Learn what using namespace std does in C++, why many developers avoid it in real code, and safer options like std:: and narrow using declarations.
std is short for standard. It is the namespace that holds the C++ standard library, including cout, string and vector. Here is what that means.
Find out what using namespace std does in C++, how it lets you skip the std:: prefix, what it does not change, and when it is safe to use in real code.
A namespace is a named scope that keeps names from clashing. This page walks through a short C++ example with two namespaces that share a name.
Use std:: by default. Learn when a using declaration for one name is enough, when a directive is fine, and why headers should avoid it entirely.
Related topics