Unnamed or Anonymous namespaces and std namespace in C++

Unnamed or Anonymous namespaces are used to create identifiers which are known to that particular file where the unnamed namespace is declared. They are unknown outside the file.

Syntax of unnamed namespace:

namespace {


std namespace: std is the namespace for C++ standard library. By including this namespace you are actually including all the standard library functions of C++. It is declared as:

using namespace std;

Leave a Reply