Namepaces in C++

You all have seen in previous post (Helloworld program) we have used something called as namespace . What it is actually? What its use?

Namespaces provide a method for preventing name conflicts in large projects.

Symbols declared inside a namespace block are placed in a named scope that prevents them from being mistaken for identically-named symbols in other scopes.

Multiple namespace blocks with the same name are allowed. All declarations within those blocks are declared in the named scope.

 using namepace std;

It includes all C++ standard Libraries.

EXAMPLE:-

 

1 Comment

  1. Pingback: Standard library header files in C++ |

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s